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