diff --git a/BulkCargo_UnityProject/Assets/Scripts/wj/Camera/CameraRoamManager.cs b/BulkCargo_UnityProject/Assets/Scripts/wj/Camera/CameraRoamManager.cs index 240b0dbf..44311850 100644 --- a/BulkCargo_UnityProject/Assets/Scripts/wj/Camera/CameraRoamManager.cs +++ b/BulkCargo_UnityProject/Assets/Scripts/wj/Camera/CameraRoamManager.cs @@ -64,6 +64,16 @@ public class CameraRoamManager : Singleton /// 漫游速度 /// public float RoamingSpeed = 2; + /// + /// Dopath参数 + /// + [Range(0, 1)] + public float look = 0; + + public bool ConstraintXAxis; + public bool ConstraintYAxis; + public bool ConstraintZAxis; + public Vector3 ConstraintValue; // Start is called before the first frame update void Start() { @@ -78,7 +88,9 @@ public class CameraRoamManager : Singleton m_Position = TargetCamera.position; m_Rotation = TargetCamera.rotation; - TargetCamera.rotation = Quaternion.Euler(m_Rotation.eulerAngles.x, m_Rotation.eulerAngles.y, 0); + TargetCamera.rotation = Quaternion.Euler(ConstraintXAxis ? ConstraintValue.x : m_Rotation.eulerAngles.x, + ConstraintYAxis ? ConstraintValue.y : m_Rotation.eulerAngles.y, + ConstraintZAxis ? ConstraintValue.z : m_Rotation.eulerAngles.z); } } @@ -108,8 +120,7 @@ public class CameraRoamManager : Singleton } } } - [Range(0, 1)] - public float look = 0; + /// /// 执行自动漫游 ///