protected override void OnDisable() { base.OnDisable(); LookController.Get().m_WantedLookDev.y = 0f; this.m_Player.m_AudioModule.StopHarvestAnimalSound(); this.m_StoneBlade.SetActive(false); if (this.m_Animator.isInitialized) { this.m_Animator.ResetTrigger(this.m_HarvestingHash); this.m_Animator.ResetTrigger(this.m_HarvestingFinishHash); } }
protected override void OnDisable() { base.OnDisable(); this.m_Animator.SetBool(this.m_HarvestingHash, false); this.m_AudioSource.Stop(); if (this.m_InInventory) { Player.Get().m_OpenBackpackSheduled = true; } if (this.m_Item != null) { this.m_Item.enabled = true; } LookController.Get().m_LookDev.y = 0f; LookController.Get().m_WantedLookDev.y = 0f; }
private void OnEnterState() { if (this.m_State == AnimationTriggerController.State.Enter) { LookController.Get().SetWantedLookDir(this.m_Trigger.m_TransformObject.transform.forward); return; } if (this.m_State == AnimationTriggerController.State.Animation) { LookController.Get().SetWantedLookDir(Vector3.zero); this.m_Animator.CrossFade(this.m_Trigger.m_PlayerAnimationHash, 0.1f, 0); this.m_Animator.CrossFade(this.m_Trigger.m_PlayerAnimationHash, 0.1f, 1); this.m_Trigger.PlayAnim(); LookController.Get().m_LookDev.y = 0f; LookController.Get().m_WantedLookDev.y = 0f; base.ResetBodyRotationBonesParams(); } }
protected override void OnDisable() { base.OnDisable(); this.m_Animator.CrossFade(this.m_Idle, 0.2f, 0); this.m_Animator.CrossFade(this.m_UnarmedIdle, 0.2f, 1); if (this.m_Trigger && Player.Get()) { Collider[] componentsInChildren = this.m_Trigger.GetComponentsInChildren <Collider>(); for (int i = 0; i < componentsInChildren.Length; i++) { Physics.IgnoreCollision(componentsInChildren[i], Player.Get().m_Collider, false); } } if (this.m_State == AnimationTriggerController.State.Animation && this.m_Trigger) { ScenarioManager.Get().SetBoolVariable(this.m_Trigger.m_ScenarioBoolVariable, true); } LookController.Get().m_LookDev.y = 0f; LookController.Get().m_WantedLookDev.y = 0f; base.ResetBodyRotationBonesParams(); FPPController.Get().ResetBodyRotationBonesParams(); }
protected override void OnDisable() { base.OnDisable(); LookController.Get().m_WantedLookDev.y = 0f; this.m_Player.m_AudioModule.StopHarvestAnimalSound(); if (this.m_Animator.isInitialized) { this.m_Animator.SetBool(this.m_MudMixerHash, false); } Collider collider = Player.Get().m_Collider; Physics.IgnoreCollision(collider, this.m_Mixer.m_BoxCollider, false); foreach (Collider collider2 in this.m_Mixer.gameObject.GetComponentsInChildren <Collider>()) { Physics.IgnoreCollision(collider, collider2, false); } this.m_Mixer.OnFinishMixing(); LookController.Get().m_LookDev.y = 0f; LookController.Get().m_WantedLookDev.y = 0f; base.ResetBodyRotationBonesParams(); FPPController.Get().ResetBodyRotationBonesParams(); }
private void UpdateEnterState() { Vector3 vector = this.m_Trigger.m_TransformObject.transform.position - base.transform.position; Vector3 a = vector.normalized * this.m_Speed; float f = Vector3.Angle(Player.Get().transform.forward.GetNormalized2D(), this.m_Trigger.m_TransformObject.transform.forward.GetNormalized2D()); Vector3 motion = a * Time.deltaTime; if (vector.To2D().magnitude > motion.magnitude || Mathf.Abs(f) > 1f) { if (vector.To2D().magnitude > motion.magnitude) { this.m_CharacterController.Move(motion, true); } else { this.m_CharacterController.Move(vector, true); } LookController.Get().UpdateWantedLookDir(); FPPController.Get().UpdateBodyRotation(); return; } this.m_CharacterController.Move(vector, true); this.SetState(AnimationTriggerController.State.Animation); }