17 lines
292 B
C#
17 lines
292 B
C#
using UnityEngine;
|
|
using System.Collections;
|
|
|
|
[RequireComponent(typeof(Health))]
|
|
public class GameoverOnDeath : MonoBehaviour {
|
|
public GameController gameController;
|
|
|
|
void Start () {
|
|
GetComponent<Health>().Destroyed += OnDeath;
|
|
}
|
|
|
|
void OnDeath(){
|
|
gameController.GameOver();
|
|
}
|
|
|
|
}
|