Exemple #1
0
 // Make sure the player and platform can collide with each other again.
 void OnTriggerExit2D(Collider2D other)
 {
     // If the collider is the player's trigger...
     if (other.gameObject.tag == "Player")
     {
         // ... start the enable timer.
         platform.StartEnableTimer();
         // Make sure the player is considered 'outside' the platform.
         platform.insidePlatform = false;
     }
 }
        // Function to determine if the player is allowed to jump down.
        void OnTriggerExit2D(Collider2D other)
        {
            if (other.gameObject.tag == "Player")
            {
                canJumpDown           = false;
                playerScript.jumpDown = false;

                // If the player isn't inside the platform, start the enable timer.
                if (!platform.insidePlatform)
                {
                    platform.StartEnableTimer();
                }
            }
        }