Exemplo n.º 1
0
 void Update()
 {
     //If you're on the ground, disable the ps
     //Else, enable it
     if (playerScript.IsGrounded())
     {
         if (ps.isPlaying)
         {
             ps.Stop();
         }
     }
     else
     {
         if (!ps.isPlaying)
         {
             ps.Play();
         }
     }
 }
Exemplo n.º 2
0
    void Update()
    {
        if (stunned || !controller.isAlive || GameControl.instance.minigameOver)
        {
            return;
        }

        if (Moved())
        {
            EnableParticles();

            prevPos = transform.position;
        }
        else
        {
            DisableParticles();
        }


        //If down is pressed and you're on the ground
        string vertical = "Vertical" + controller.playerNum;

        //Add check for joystick users
        if (GameControl.instance.usingJoysticks)
        {
            vertical += "Joystick";
        }

        if (Input.GetAxis(vertical) < 0 && controller.IsGrounded())
        {
            //Scare opponents
            Scare();
        }
        else
        {
            sprite.enabled = false;
        }
    }