Пример #1
0
 public void DealProcessList(Coocoo3DPhysics.Physics3DScene physics3DScene)
 {
     lock (this)
     {
         for (int i = 0; i < EntityLoadList.Count; i++)
         {
             Entities.Add(EntityLoadList[i]);
             EntityLoadList[i].boneComponent.AddPhysics(physics3DScene);
         }
         for (int i = 0; i < LightingLoadList.Count; i++)
         {
             Lightings.Add(LightingLoadList[i]);
         }
         for (int i = 0; i < EntityRemoveList.Count; i++)
         {
             EntityRemoveList[i].boneComponent.RemovePhysics(physics3DScene);
             Entities.Remove(EntityRemoveList[i]);
         }
         for (int i = 0; i < EntityRefreshList.Count; i++)
         {
             EntityRefreshList[i].boneComponent.RemovePhysics(physics3DScene);
             EntityRefreshList[i].boneComponent.AddPhysics(physics3DScene);
         }
         for (int i = 0; i < LightingRemoveList.Count; i++)
         {
             Lightings.Remove(LightingRemoveList[i]);
         }
         EntityLoadList.Clear();
         LightingLoadList.Clear();
         EntityRemoveList.Clear();
         EntityRefreshList.Clear();
         LightingRemoveList.Clear();
     }
 }
Пример #2
0
        public void DealProcessList(Coocoo3DPhysics.Physics3DScene physics3DScene)
        {
            lock (this)
            {
                for (int i = 0; i < EntityLoadList.Count; i++)
                {
                    Entities.Add(EntityLoadList[i]);
                    EntityLoadList[i].rendererComponent.AddPhysics(physics3DScene);
                }
                for (int i = 0; i < EntityRemoveList.Count; i++)
                {
                    EntityRemoveList[i].rendererComponent.RemovePhysics(physics3DScene);
                    Entities.Remove(EntityRemoveList[i]);
                }
                for (int i = 0; i < EntityRefreshList.Count; i++)
                {
                    EntityRefreshList[i].rendererComponent.RemovePhysics(physics3DScene);
                    EntityRefreshList[i].rendererComponent.AddPhysics(physics3DScene);
                }
                EntityLoadList.Clear();
                EntityRemoveList.Clear();
                EntityRefreshList.Clear();

                for (int i = 0; i < gameObjectLoadList.Count; i++)
                {
                    gameObjects.Add(gameObjectLoadList[i]);
                }
                for (int i = 0; i < gameObjectRemoveList.Count; i++)
                {
                    gameObjects.Remove(gameObjectRemoveList[i]);
                }
                gameObjectLoadList.Clear();
                gameObjectRemoveList.Clear();
            }
        }