Ejemplo n.º 1
0
        public void RemoveGameObject(NetGameObject inGameObject)
        {
            int index = inGameObject.GetIndexInWorld();

            int lastIndex = mGameObjects.Count - 1;

            if (index != lastIndex)
            {
                mGameObjects[index] = mGameObjects[lastIndex];
                mGameObjects[index].SetIndexInWorld(index);
            }

            inGameObject.SetIndexInWorld(-1);

            mGameObjects.RemoveAt(lastIndex);

            inGameObject.CompleteRemove();

            //mWorldMap.RemoveObject(inGameObject);

            if (inGameObject.GetMapId() != 0)
            {
                RemoveNetGameObject((GameObjectClassId)inGameObject.GetClassId(), inGameObject.GetMapId());
            }
        }