コード例 #1
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (ArcadePhysics.SameWorld(this, other))
     {
         // only trigger if this component is on
         if (enabled)
         {
             // and now it's time to stop the level
             FinalizeLevel.CrossFinishLine(clock.GetTime());
         }
     }
 }
コード例 #2
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (ArcadePhysics.SameWorld(this, other))
     {
         if (enabled)
         {
             // the game ends when the player touches the exit portal
             if (other.gameObject.CompareTag(Magic.Tags.PLAYER))
             {
                 FinalizeLevel.FinishGame();
             }
         }
     }
 }