浏览代码

Fix in First Person Controller OnValidate

/main
Thomas ICHÉ 5 年前
当前提交
90960fd7
共有 1 个文件被更改,包括 6 次插入3 次删除
  1. 9
      Runtime/Controllers/FirstPersonController.cs

9
Runtime/Controllers/FirstPersonController.cs


public void OnValidate()
{
float realHeight = PlayerHeight + PlayerRadius;
m_Controller.center = new Vector3(0, realHeight / 2, 0);
m_Controller.height = realHeight;
m_Controller.radius = PlayerRadius;
var controller = GetComponent<CharacterController>();
controller.center = new Vector3(0, realHeight / 2, 0);
controller.height = realHeight;
controller.radius = PlayerRadius;
if(m_Camera != null)
m_Camera.transform.localPosition = new Vector3(0, PlayerHeight, 0);

正在加载...
取消
保存