Exemplo n.º 1
0
 public void TouchedWater(MovingObject movingObject)
 {
     if (_gameManager == null)
     {
         _gameManager = GameObject.Find("GameManager").GetComponent <GameManager>();
     }
     if (!_gameManager.GamePlaying())
     {
         // Nothing should move
         return;
     }
     // Detect if this object floats
     if (movingObject.CanFloat)
     {
         if (movingObject.gameObject.tag == "Platform")
         {
             _currentPlatform = movingObject.gameObject;
         }
         Move(movingObject);
     }
     else
     {
         movingObject.GetComponent <BoxCollider>().enabled = false;
         movingObject.FellInWater();
         movingObject.Respawn();
     }
 }