LuaInterface.LuaObjectPool.Replace C# (CSharp) Method

Replace() public method

public Replace ( int pos, object o ) : object
pos int
o object
return object
        public object Replace(int pos, object o)
        {
            if (pos > 0 && pos < count)
            {
                object obj = list[pos].obj;
                list[pos].obj = o;
                return obj;
            }

            return null;
        }

Usage Example

示例#1
0
        public void SetBack(int index, object o)
        {
            object obj = objects.Replace(index, o);

            objectsBackMap.Remove(obj);
            objectsBackMap[o] = index;
        }
All Usage Examples Of LuaInterface.LuaObjectPool::Replace