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); } } } }