本文整理汇总了C#中IWorld.CreateEntity方法的典型用法代码示例。如果您正苦于以下问题:C# IWorld.CreateEntity方法的具体用法?C# IWorld.CreateEntity怎么用?C# IWorld.CreateEntity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IWorld
的用法示例。
在下文中一共展示了IWorld.CreateEntity方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestSystemAddedAfterEntity
public void TestSystemAddedAfterEntity()
{
world = CreateWorld();
info = world.DebugInfo;
AddComponents(world.CreateEntity(), new ComponentA());
AddComponents(world.CreateEntity(), new ComponentB());
AddComponents(world.CreateEntity(), new ComponentB(), new ComponentC());
systemO = new EmptySystem();
systemA = new SystemA();
systemB = new SystemB();
systemBC = new SystemBC();
world.AddSystem(systemO);
world.AddSystem(systemA);
world.AddSystem(systemB);
world.AddSystem(systemBC);
AddComponents(world.CreateEntity(), new ComponentA());
Assert.AreEqual(4, info.EntityCount(systemO));
Assert.AreEqual(2, info.EntityCount(systemA));
Assert.AreEqual(2, info.EntityCount(systemB));
Assert.AreEqual(1, info.EntityCount(systemBC));
}
示例2: Setup
private void Setup()
{
world = CreateWorld(new SystemA(), new SystemBC());
finder = world.EntityFinder;
Entity entity = world.CreateEntity();
entity.Add(new ComponentA());
entity.Add(new ComponentB());
entity = world.CreateEntity();
entity.Add(new ComponentA());
entity = world.CreateEntity();
entity.Add(new ComponentA());
entity = world.CreateEntity();
entity.Add(new ComponentB());
entity = world.CreateEntity();
entity.Add(new ComponentB());
entity = world.CreateEntity();
entity.Add(new ComponentA());
entity.Add(new ComponentB());
entity = world.CreateEntity();
entity.Add(new ComponentA());
entity.Add(new ComponentB());
}