예제 #1
0
 public void HasSingletonThrowsMultiple()
 {
     Assert.IsFalse(EmptySystem.HasSingleton <EcsTestData>());
     m_Manager.CreateEntity(typeof(EcsTestData));
     Assert.IsTrue(EmptySystem.HasSingleton <EcsTestData>());
     m_Manager.CreateEntity(typeof(EcsTestData));
     Assert.IsFalse(EmptySystem.HasSingleton <EcsTestData>());
 }
예제 #2
0
        public void HasSingleton_ReturnsTrueWithEntityWithOnlyComponent()
        {
            Assert.IsFalse(EmptySystem.HasSingleton <EcsTestData>());

            m_Manager.CreateEntity(typeof(EcsTestData));
            Assert.IsTrue(EmptySystem.HasSingleton <EcsTestData>());

            m_Manager.CreateEntity(typeof(EcsTestData));
            Assert.IsFalse(EmptySystem.HasSingleton <EcsTestData>());
        }
예제 #3
0
 public void HasSingletonWorks_ManagedComponents()
 {
     Assert.IsFalse(EmptySystem.HasSingleton <EcsTestManagedComponent>());
     m_Manager.CreateEntity(typeof(EcsTestManagedComponent));
     Assert.IsTrue(EmptySystem.HasSingleton <EcsTestManagedComponent>());
 }