private void Update() { JoystickAdaptor.Update(); switch (State) { case ChuteState.Skydive: transform.rotation = Quaternion.Slerp(transform.rotation, m_TargetRotate, 0.03f); float forward = SkyDirveAnimatorControl(); if (OnSkyDirveEvent != null) { OnSkyDirveEvent(forward); } break; case ChuteState.Deployed: DeployedAnimatorControl(); break; } if (OnUpdate != null) { OnUpdate(TerrainAltitude, m_ObjectToMove.GetPosition().y, Velocity.y); } }
protected void OnAwake() { m_Transform = GetComponent <Transform>(); m_Rigidbody = GetComponent <Rigidbody>(); m_Animator = GetComponent <Animator>(); m_ObjectToMove = GetComponent <ObjectToMove>(); m_lastAltitude = float.MaxValue; m_CurTransform = m_Transform; m_ImpactDistance = float.MaxValue; JoystickAdaptor = new JoystickAdaptor(1); m_PackLocalMotionHash = Animator.StringToHash("Base Layer.Pack_Locomotion"); }
private void Update() { JoystickAdaptor.Update(); switch (State) { case ChuteState.Skydive: SkyDirveAnimatorControl(); break; case ChuteState.Deployed: DeployedAnimatorControl(); break; } if (m_ShadowPosition != Vector3.zero) { UpdateShadow(); } }