示例#1
0
文件: Pool.cs 项目: 00492/SDJ_Part1
    public virtual PoolItem GetAPoolObject()
    {
        int index = _inactives.Count - 1;

        if (index < 0)
        {
            AddToPool();
            index = 0;
        }
        PoolItem obj = _inactives[index];

        _inactives.RemoveAt(index);
        _actives.Add(obj);
        obj.Activate();
        return(obj);
    }