Skip to content

Instantly share code, notes, and snippets.

@Templar2020
Created October 1, 2015 00:15
Show Gist options
  • Save Templar2020/1527ec21345ed6a8cf6f to your computer and use it in GitHub Desktop.
Save Templar2020/1527ec21345ed6a8cf6f to your computer and use it in GitHub Desktop.
using UnityEngine;
using System.Collections;
public class KillPlayer : MonoBehaviour {
public LevelManager levelManager;
// Use this for initialization
void Start () {
levelManager = FindObjectOfType <LevelManager>();
}
// Update is called once per frame
void Update () {
}
void OnTriggerEnter2D(Collider2D other){
if(other.name == "Player"){
levelManager.RespawnPlayer();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment