Exemple #1
0
    void Release(Type poolType, IPoolObject poolObject)
    {
        List <IPoolObject> poolObjectList = null;

        if (_poolObjectDict.TryGetValue(poolType, out poolObjectList))
        {
            if (poolObjectList.IndexOf(poolObject) != -1)
            {
                poolObject.Clear();
                poolObject.IsInUse = false;
            }
            else
            {
                LogUtil.W("PoolManager Can't find PoolObject {0}!", poolObject.ToString());
            }
        }
        else
        {
            LogUtil.W("PoolManager Can't find PoolName {0}!", poolType.ToString());
        }
    }
Exemple #2
0
        static void ReleaseImpl(IPoolObject poolObject)
        {
            var poolType = poolObject.GetType();
            List <IPoolObject> poolObjectList = null;

            if (_poolObjectDict.TryGetValue(poolType, out poolObjectList))
            {
                if (poolObjectList.IndexOf(poolObject) != -1)
                {
                    poolObject.Clear();
                    poolObject.IsInUse = false;
                }
                else
                {
                    Log.W("PoolManager Can't find PoolObject {0}!", poolObject.GetType().ToString());
                }
            }
            else
            {
                Log.W("PoolManager Can't find PoolName {0}!", poolType.ToString());
            }
        }