/// <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); }
public void LookAtPlayer(Vector3 direction) { _defaultMesh.transform.rotation = Quaternion.LookRotation(direction.SetY(0), Vector3.up); }