private void Awake() { //得到组件 model = GameObject.FindWithTag("Player"); animator = model.GetComponent <Animator>(); cc = model.GetComponent <CharacterController>(); pi = ScriptTool.GetScript <PlayerInput>("_Player"); cameraControl = ScriptTool.GetScript <CameraControl>("_Camera"); RegisterFSMEvents(); //控制Root Motion model.GetComponent <RootMotionControl>().RMUpdateEvent += OnRMUpdate; }
private void Awake() { //使鼠标不可见 Cursor.visible = false; _LockIcon.enabled = false; model = GameObject.FindWithTag("Player"); pi = ScriptTool.GetScript <PlayerInput>("_Player"); mainCamera = Camera.main; if (mainCamera == null) { throw new NullReferenceException("空引用:" + nameof(mainCamera)); } cameraOffset = mainCamera.transform.parent.gameObject; cameraRotation_X = cameraOffset.transform.parent.gameObject; cameraRotation_Y = cameraRotation_X.transform.parent.gameObject; tempEulerX = 20; }