Exemple #1
0
    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);
    }
Exemple #2
0
 private void Awake()
 {
     objectReturner = GetComponent <ObjectReturner>();
 }
Exemple #3
0
 void OnEnable()
 {
     cReturn = GetComponent <ObjectReturner>();
 }