Exemplo n.º 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);
    }
Exemplo n.º 2
0
 private void Awake()
 {
     objectReturner = GetComponent <ObjectReturner>();
 }
Exemplo n.º 3
0
 void OnEnable()
 {
     cReturn = GetComponent <ObjectReturner>();
 }