Example #1
0
 private void Awake()
 {
     if (instance != null)
     {
         DestroyImmediate(gameObject);
     }
     else
     {
         instance = this;
         SceneManager.sceneLoaded   += OnSceneLoad;
         SceneManager.sceneUnloaded += OnSceneUnload;
         CreatePools(SceneManager.GetActiveScene());
         DontDestroyOnLoad(gameObject);
     }
 }
Example #2
0
 public void PutToPool(GameObject gameObject)
 {
     PoolsManager.GetGameObjectsPool(relatedSceneIndex, templateTagName).Put(gameObject);
 }
Example #3
0
 public GameObject TakeFromPool(Vector3 position, Quaternion rotation)
 {
     return(PoolsManager.GetGameObjectsPool(relatedSceneIndex, templateTagName).Take(position, rotation));
 }
Example #4
0
 public GameObject TakeFromPool()
 {
     return(PoolsManager.GetGameObjectsPool(relatedSceneIndex, templateTagName).Take());
 }