Created
December 14, 2013 07:56
-
-
Save jquave/7956670 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using UnityEngine; | |
| using System.Collections; | |
| public class Checkpoint : MonoBehaviour { | |
| void OnTriggerEnter2D(Collider2D col) | |
| { | |
| Player p = col.GetComponent<Player>(); | |
| if( p != null) { | |
| // Player touched pickup | |
| renderer.material.SetColor("_Color", Color.green); | |
| p.HitCheckpoint(this); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment