提交日志-20240702-2039:

1、新增相机漫游角度约束配置
This commit is contained in:
Afeijia 2024-07-02 20:39:31 +08:00
parent d32c6baf95
commit be581b7c74
1 changed files with 14 additions and 3 deletions

View File

@ -64,6 +64,16 @@ public class CameraRoamManager : Singleton<CameraRoamManager>
/// 漫游速度
/// </summary>
public float RoamingSpeed = 2;
/// <summary>
/// Dopath²ÎÊý
/// </summary>
[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<CameraRoamManager>
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<CameraRoamManager>
}
}
}
[Range(0, 1)]
public float look = 0;
/// <summary>
/// 执行自动漫游
/// </summary>