Created
November 30, 2023 18:12
-
-
Save SamatKadyrov/6ef008dce1dbdc6283215415e3d5dc5a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class VectorOperations : MonoBehaviour | |
{ | |
[SerializeField] private Vector3 _playerPosition = new Vector2(3, 1); | |
[SerializeField] private Vector3 _guardPosition = new Vector2(1, 2); | |
private float _dotResult; | |
private Vector3 _fieldOfView = new Vector2(1, 1); | |
private void Start() | |
{ | |
_dotResult = Vector2.Dot(_fieldOfView, (_playerPosition - _guardPosition)); | |
Debug.Log(_dotResult); // Выведет 1, значит угол острый | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment