public void ReturnToPool(PoolableType instType, GameObject inst) { if (!poolDict.ContainsKey(instType)) { Debug.LogError("Instance is invalid", instType); } ObjectReturner instObjReturner = inst.GetComponent <ObjectReturner>(); if (instObjReturner.inActiveSegment) { instObjReturner.inActiveSegment = false; segmentActiveCount--; } Queue <GameObject> instQueue = poolDict[instType]; inst.SetActive(false); instQueue.Enqueue(inst); }
private void Awake() { objectReturner = GetComponent <ObjectReturner>(); }
void OnEnable() { cReturn = GetComponent <ObjectReturner>(); }