/// <summary>
 /// ターゲットとの高さを無視した距離を返す
 /// </summary>
 /// <param name="origin"></param>
 /// <param name="target"></param>
 /// <returns></returns>
 public static float GetDistance2D(this Vector3 origin, Vector3 target)
 {
     return Mathf.Abs((origin.SetY(0) - target.SetY(0)).magnitude);
 }
예제 #2
0
파일: Chaser.cs 프로젝트: harjup/Xyz
 public void LookAtPlayer(Vector3 direction)
 {
     _defaultMesh.transform.rotation = Quaternion.LookRotation(direction.SetY(0), Vector3.up);
 }