コード例 #1
0
        private void CommitDive()
        {
            if (ANIMATION_DATA.PlayTime < DiveTime)
            {
                return;
            }

            if (ANIMATION_DATA.PlayTime > RollTime)
            {
                return;
            }

            CONTROL_MECHANISM.RIGIDBODY.useGravity = true;
            CONTROL_MECHANISM.TriggerColliderControl(DynamicColliderType.DEFAULT);

            if (IsDiving)
            {
                if (!StopAnimationTriggered)
                {
                    StopAnimationTriggered = true;
                    ANIMATION_DATA.StopAnimation();
                }
                UpdateFallTilt();
            }
        }
コード例 #2
0
 public override void ClearState()
 {
     CONTROL_MECHANISM.RIGIDBODY.useGravity = true;
     IsDiving               = false;
     DiveChecked            = false;
     StopAnimationTriggered = false;
     CONTROL_MECHANISM.TriggerColliderControl(DynamicColliderType.DEFAULT);
 }
コード例 #3
0
 public override void InitState()
 {
     ANIMATION_DATA.DesignatedAnimation = PlayerState.JumpOver.ToString();
     IsDiving = false;
     StopAnimationTriggered = false;
     CONTROL_MECHANISM.RIGIDBODY.useGravity = false;
     CONTROL_MECHANISM.RIGIDBODY.AddForce(Vector3.up * 17.5f);
     CONTROL_MECHANISM.TriggerColliderControl(DynamicColliderType.JumpOver);
 }
コード例 #4
0
        private void Roll()
        {
            //check for ground collision
            if (!ANIMATION_DATA.AnimationIsPlaying())
            {
                if (move.IsGoingToLand() || MOVEMENT_DATA.IsGrounded)
                {
                    CONTROL_MECHANISM.ClearVelocity();
                    ANIMATION_DATA.PlayAnimation();
                }
            }

            //resume normal play
            if (ANIMATION_DATA.PlayTime >= RollTime)
            {
                SetDefaultTilt();
                move.MoveForward(MOVEMENT_DATA.RunSpeed * 0.9f, CHARACTER_TRANSFORM.rotation.eulerAngles.y);
                CONTROL_MECHANISM.TriggerColliderControl(DynamicColliderType.DEFAULT);
            }
        }