Beispiel #1
0
    public void recyclePoolData(string url, GameObject go, BumObjType objtype)
    {
        Dictionary <string, Queue <GameObject> > tempDic;
        Queue <GameObject> queue;

        if (tempPoolDic.TryGetValue(objtype, out tempDic))
        {
            if (tempDic.TryGetValue(url, out queue))
            {
                queue.Enqueue(go);
            }
            else
            {
                queue = new Queue <GameObject>();
                queue.Enqueue(go);
                tempDic.Add(url, queue);
            }
        }
        else
        {
            queue = new Queue <GameObject>();
            queue.Enqueue(go);
            tempDic.Add(url, queue);
            tempPoolDic.Add(objtype, tempDic);
        }
    }
Beispiel #2
0
    public GameObject getPoolData(string url, BumObjType objType)
    {
        Dictionary <string, Queue <GameObject> > tempDic;
        Queue <GameObject> queue;

        if (tempPoolDic.TryGetValue(objType, out tempDic))
        {
            if (tempDic.TryGetValue(url, out queue))
            {
                return(queue.Dequeue());
            }
        }
        return(null);
    }