コード例 #1
0
        public void WhenOptionNotSpecified_ShouldNotCreateWorldFromConstructor()
        {
            worldOptions.CreateWorldOnInstantiate = false;
            MyWorldCreator worldManager = new MyWorldCreator(worldOptions);

            current = new MyWorldBaseImpl(worldOptions, worldManager);
            Assert.IsFalse(worldManager.CalledBootStrapCreateWorld);
        }
コード例 #2
0
        public void ShouldHaveCorrectSystems()
        {
            MyWorldCreator wm = new MyWorldCreator(worldOptions);

            current = new MyWorldBaseImpl(worldOptions, wm);
            wm.CreateWorld();
            Assert.IsNotNull(current.World.GetExistingSystem <EventComponentSystem>());
        }
コード例 #3
0
        public void DestroyWorld_ShouldCreateSingleton()
        {
            worldOptions.CreateWorldOnInstantiate = true;
            MyWorldCreator worldManager = new MyWorldCreator(worldOptions);

            current = new MyWorldBaseImpl(worldOptions, worldManager);
            current.DestroyWorld();
            Assert.AreEqual(1,
                            current.World.EntityManager.CreateEntityQuery(typeof(DestroyWorld)).CalculateEntityCount());
        }