parent
d32c6baf95
commit
be581b7c74
|
@ -64,6 +64,16 @@ public class CameraRoamManager : Singleton<CameraRoamManager>
|
||||||
/// 漫游速度
|
/// 漫游速度
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public float RoamingSpeed = 2;
|
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
|
// Start is called before the first frame update
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
|
@ -78,7 +88,9 @@ public class CameraRoamManager : Singleton<CameraRoamManager>
|
||||||
m_Position = TargetCamera.position;
|
m_Position = TargetCamera.position;
|
||||||
m_Rotation = TargetCamera.rotation;
|
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>
|
||||||
/// 执行自动漫游
|
/// 执行自动漫游
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
Loading…
Reference in New Issue