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