void Awake() { if (spawner == null) { DontDestroyOnLoad(gameObject); spawner = this; } else if (spawner != this) { // There can be only one! Destroy(gameObject); } }
public void Clear() { PCSpawner.spawner = null; Destroy(this.gameObject); }