本文整理汇总了C#中IWorld.AddSystem方法的典型用法代码示例。如果您正苦于以下问题:C# IWorld.AddSystem方法的具体用法?C# IWorld.AddSystem怎么用?C# IWorld.AddSystem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IWorld
的用法示例。
在下文中一共展示了IWorld.AddSystem方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: TestSystemUpdateSingle
public void TestSystemUpdateSingle()
{
world = CreateWorld();
SystemU u = new SystemU();
world.AddSystem(u);
world.Update<SystemU>(1);
Assert.AreEqual(true, u.IsUpdated, "Expect U to be updated.");
}
示例3: TestSystemUpdateSingleOther
public void TestSystemUpdateSingleOther()
{
world = CreateWorld();
SystemU u = new SystemU();
world.AddSystem(u);
world.Update<SystemA>(1);
Assert.AreEqual(false, u.IsUpdated, "Expect U to not be updated, only A is updated.");
}
示例4: TestSystemExcludedUpdate
public void TestSystemExcludedUpdate()
{
world = CreateWorld();
SystemU u = new SystemU();
world.AddSystem(u);
world.UpdateAll(1, typeof(SystemU));
Assert.AreEqual(false, u.IsUpdated, "Expect U to be excluded, and thus not updated.");
}