*
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user