コード例 #1
0
 // Start is called before the first frame update
 void Start()
 {
     if (GameOptions.GetDancepadMode())
     {
         currentMaxSpeed_ = dancePadMaxSpeed;
     }
     else
     {
         currentMaxSpeed_ = normalMaxSpeed;
     }
 }
コード例 #2
0
        public void GetRuns()
        {
            if (GameOptions.GetDancepadMode())
            {
                if ((rwPlayer.GetButtonDown("RunL") || rwPlayer.GetButtonDown("RunR")) && _currentFunds >= costOfMove && pc.IsGrounded())
                {
                    SetCurrentFunds(_currentFunds - costOfMove);
                    Vector2 f = dp_moveForce * Mathf.Clamp((moveForceDegenerationFactor - (CurrentVelocity / pc.CurrentMaxSpeed)), 0.0f, moveForceDegenerationFactor);
                    pc.Propel(f);
                }

                if ((!rwPlayer.GetButton("RunL") && !rwPlayer.GetButton("RunR")) && hadFootDownLastFrame)
                {
                    pc.Jump();
                }

                if (rwPlayer.GetButton("RunL") || rwPlayer.GetButton("RunR"))
                {
                    hadFootDownLastFrame = true;
                }
                else
                {
                    hadFootDownLastFrame = false;
                }

                if (rwPlayer.GetButtonDown("Slide") && hadFootDownLastFrame)
                {
                    sliding = true;
                    animator.SetBool("sliding", sliding);
                }
                else if (rwPlayer.GetButtonUp("Slide"))
                {
                    sliding = false;
                    animator.SetBool("sliding", sliding);
                }
            }
            else
            {
                if ((rwPlayer.GetButtonDown("RunL") || rwPlayer.GetButtonDown("RunR")) && _currentFunds >= costOfMove && pc.IsGrounded())
                {
                    SetCurrentFunds(_currentFunds - costOfMove);
                    Vector2 f = dp_moveForce * Mathf.Clamp((moveForceDegenerationFactor - (CurrentVelocity / pc.CurrentMaxSpeed)), 0.0f, moveForceDegenerationFactor);
                    pc.Propel(f);
                }
                if (rwPlayer.GetButtonDown("Jump"))
                {
                    pc.Jump();
                }

                if (rwPlayer.GetButtonDown("Slide"))
                {
                    sliding = true;
                    animator.SetBool("sliding", sliding);
                }
                else if (rwPlayer.GetButtonUp("Slide"))
                {
                    sliding = false;
                    animator.SetBool("sliding", sliding);
                }
            }
        }