コード例 #1
0
 //删除组件
 public void RemoveComponent(LocalComponent localComponent)
 {
     objectComponentMap[localComponent.Parent].Remove(localComponent);
     if (localComponent is ColliderComponent)
     {
         PhysicSystem.RemoveComponent((ColliderComponent)localComponent);
     }
 }
コード例 #2
0
 //为对象添加组件
 public void AddComponent(LocalComponent localComponent)
 {
     objectComponentMap[localComponent.Parent].Add(localComponent);
     if (localComponent is ColliderComponent)
     {
         PhysicSystem.AddComponent((ColliderComponent)localComponent);
     }
 }
コード例 #3
0
 //下次更新时删除组件
 public void RemoveComponentLazy(LocalComponent localComponent)
 {
     toRemoveComponents.Add(localComponent);
 }
コード例 #4
0
 //下次更新时添加组件
 public void AddComponentLazy(LocalComponent localComponent)
 {
     toAddComponents.Add(localComponent);
 }