コード例 #1
0
ファイル: Checkpoint.cs プロジェクト: Thipi/First2DPlatformer
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.tag == "pikkukaveri")
     {
         ch.UpdateCheckpoints(this.gameObject);
         Changecolor();
     }
 }
コード例 #2
0
ファイル: checkpoint.cs プロジェクト: polgafr/Unity
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.tag == "Player")
     {
         ch.UpdateCheckpoints(this.gameObject);
         {
         }
     }
 }
コード例 #3
0
 void OnTriggerStay(Collider col)
 {
     // Checks if the collision is happening between the checkpoint and the player game object
     if (input.Gameplay.Interact.triggered && col.gameObject.GetComponent <playerControl>() != null)
     {
         //triggerEntered = true;
         //Debug.Log("TRIGGER ENTERED: " + triggerEntered);
         //if (input.Gameplay.Interact.triggered)
         //{
         ch.UpdateCheckpoints(this.gameObject);     // Investigate this to see if there's a way in Update() to use this function with a keypress.
                                                    // Check if it's possible to respawn enemies
         //}
     }
 }