/// <summary> /// 目的地の方向を向く /// </summary> /// <param name="targetPos"> 目的地の座標 </param> public void LookTarget(Vector3 targetPos, GameObject obj) { Quaternion rot = Quaternion.LookRotation(targetPos - this.transform.position); if (Vector3.Angle(obj.transform.forward, (targetPos - this.transform.position).normalized) > 2f) { obj.transform.rotation = Quaternion.Lerp(obj.transform.rotation, rot, speed / 30); } else { if (decoy == null || decoy.GetIsDeath() != false) { moveFlag = true; } } }