public override void PrepareAction (){ base.PrepareAction (); if (splashesPooler == null) { GameObject splashesObject = (GameObject) Instantiate (splashesPoolerPrefab, Vector3.zero, Quaternion.identity); splashesPooler = splashesObject.GetComponent<ObjectsPooler> (); } }
private List <GameObject> pooledObjects; //list de TOUT les objets... #endregion #region Initialization /// <summary> /// Init /// </summary> public void SetSingleton() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } }
private void Awake() { if (sharedInstance == null) { sharedInstance = this; Debug.Log("sharedinstance created"); } else if (sharedInstance != this) { Destroy(gameObject); Debug.Log("destroyed dup"); } }
private void Awake() { if (instance != null && instance != this) { DestroyImmediate(gameObject); } instance = this; var filePath = Path.Combine(Application.streamingAssetsPath, "pools.json"); if (File.Exists(filePath)) { var json = File.ReadAllText(filePath); pools = JsonConvert.DeserializeObject <Pool[]>(json).ToDictionary(pool => pool.Id); } SetPoolContainers(); StartCoroutine(PrewarmPools()); }
private void Awake() { Instance = this; }