Exemplo n.º 1
0
 private void OnTriggerExit2D(Collider2D player)
 {
     if (player.tag == "Player")
     {
         playerControl = player.GetComponent <LeandrePlayerControl>();
         playerControl.setRunningSpeed(beforeSlowRunningSpeed);
         playerControl.setSlidingSpeed(beforeSlowSlidingSpeed);
     }
 }
Exemplo n.º 2
0
    private void OnTriggerEnter2D(Collider2D player)
    {
        if (player.tag == "Player")
        {
            playerControl = player.GetComponent <LeandrePlayerControl>();

            if (firstTriggerPassed == false)
            {
                beforeSlowRunningSpeed = (float)playerControl.getRunningSpeed();
                beforeSlowSlidingSpeed = (float)playerControl.getSlidingSpeed();
                firstTriggerPassed     = true;
            }

            playerControl.setRunningSpeed(playerControl.getRunningSpeed() * 0.1f);
            playerControl.setSlidingSpeed(playerControl.getSlidingSpeed() * 0.1f);
        }
    }