public static PoolingController instance; //unique class instance for the easy access private void Awake() { if (instance == null) { instance = this; } }
public void SetPoolingManager(PoolingController p_poolingController) { if (_poolingController != null) { Debug.LogWarning("AudioManagerBase: Overwriting pooling manager!"); } _poolingController = p_poolingController; }
public static PoolingController getInstance() { if (instance == null) { instance = FindObjectOfType <PoolingController>(); } return(instance); }
protected override void OnEnable() { base.OnEnable(); ScenesManager.OnSceneIsGoingToLoad += OnSceneIsGoingToLoad; ScenesManager.OnSceneLoaded += OnSceneLoaded; OnEnableChild(); if (_poolingController == null) { _poolingController = GetComponentInChildren <PoolingController>(); } }
public void Initialize() { if (PoolingManager == null) { PoolingManager = this; // DontDestroyOnLoad(this.gameObject); } else { Destroy(this.gameObject); } foreach (Box obj in items) { obj.gameObject.SetActive(false); } }
public void Initialize() { if (PoolingManager == null) { PoolingManager = this; // DontDestroyOnLoad(this.gameObject); } else { Destroy(this.gameObject); } foreach (Letter item in letters) { item.gameObject.SetActive(false); } foreach (Word item in wordbase) { item.gameObject.SetActive(false); } }
void Awake() { s = this; }
private void OnCollisionEnter(Collision other) { PoolingController.getInstance().AddToPool(gameObject); }
void fire() { GameObject bullet = PoolingController.getInstance().GetBullet(); bullet.GetComponent <BulletScript>().Fire(barrel); }