17 lines
300 B
C#
17 lines
300 B
C#
using UnityEngine;
|
|
using System.Collections;
|
|
|
|
public class RespawnNotify : MonoBehaviour {
|
|
public ISpawner spawner;
|
|
public bool destroyOnRespawn = true;
|
|
|
|
void OnKill(GameObject obj){
|
|
if (spawner != null) {
|
|
spawner.Respawn();
|
|
if(destroyOnRespawn){
|
|
Destroy(gameObject);
|
|
}
|
|
}
|
|
}
|
|
}
|