private void OnDestroy() { if (s_instance == this) { s_instance = null; } }
public void destroyAndRespawnFromBottom() { DoorsControl doors = GameObject.FindGameObjectWithTag("Doors").GetComponent <DoorsControl>(); doors.newEnemyFromBottom(); Destroy(gameObject); }
private void Awake() { if (s_instance != null) { Debug.LogError("DoorsControl already exists."); } s_instance = this; }