Пример #1
0
 protected virtual void Start()
 {
     InitSpawners();
     if (Main != null)
     {
         Debug.LogWarning("More than one TeleportManager exists");
         return;
     }
     Main = this;
 }
Пример #2
0
 protected virtual void OnDestroy()
 {
     foreach (var spawner in _clientSpawners)
     {
         spawner.DestroySelf();
     }
     foreach (var spawner in _serverSpawners)
     {
         spawner.DestroySelf();
     }
     _clientSpawners.Clear();
     _serverSpawners.Clear();
     if (Main == this)
     {
         Main = null;
     }
 }