Ejemplo n.º 1
0
 private void OnPhysicsCollisionExit(PhysicsCollider other)
 {
     if (PlayerOn && other.GetComponent <PlayerMovement>())
     {
         Debug.Log("Player leaving planet");
         PlayerOn = null;
     }
 }
Ejemplo n.º 2
0
 void OnPhysicsCollisionEnter(PhysicsCollider other)
 {
     if (other.CompareTag("Terrain"))               //hit planet
     {
         if (onPlanet == null)
         {
             Debug.Log("Hit planet");
             physics.attractionActive = false;
             physics.Stop();
             onPlanet = other.GetComponent <Planet>();
         }
         else                     //squished between planets
                                  //TODO: kill player (probably a different script tho)
         {
         }
     }
 }
Ejemplo n.º 3
0
 private void OnPhysicsCollisionEnter(PhysicsCollider other)
 {
     Debug.Log("Player entering planet");
     PlayerOn = other.GetComponent <PlayerMovement>();
 }