Skip to content

Instantly share code, notes, and snippets.

@jquave
Created December 14, 2013 07:56
Show Gist options
  • Select an option

  • Save jquave/7956670 to your computer and use it in GitHub Desktop.

Select an option

Save jquave/7956670 to your computer and use it in GitHub Desktop.
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