private void OnDestroy() { _instance = null; pickPoolables.Clear(); if (poolScene.isLoaded) { SceneManager.UnloadSceneAsync(poolScene); } }
private void Awake() { _instance = this; //poolScene = SceneManager.GetSceneByName("Pool"); //if (poolScene == default(Scene)) { poolScene = SceneManager.CreateScene("Pool"); //SceneManager.LoadSceneAsync(poolScene.name, LoadSceneMode.Additive); } //poolContainer = new GameObject().transform; //poolContainer.SetParent(transform); //poolContainer.gameObject.SetActive(false); foreach (var prefab in prefabs) { AddPool_Private(prefab, initialSpawnCount); } }