Beispiel #1
0
        public void EntityListView_ShowEntitiesFromWorld()
        {
            m_Manager.CreateEntity();
            var emptySystem   = World.Active.GetOrCreateManager <EmptySystem>();
            var selectedWorld = World.Active;
            ScriptBehaviourManager currentSystem = null;

            using (var listView = new EntityListView(new TreeViewState(), null, SetEntitySelection, () => selectedWorld,
                                                     () => currentSystem, x => {}))
            {
                currentSystem = World.Active.GetExistingManager <EntityManager>();
                listView.SelectedEntityQuery = AllQuery;
                Assert.IsTrue(listView.ShowingSomething);
                Assert.AreEqual(1, listView.GetRows().Count);

                currentSystem = World.Active.GetExistingManager <EntityManager>();
                listView.SelectedEntityQuery = null;
                Assert.IsTrue(listView.ShowingSomething);
                Assert.AreEqual(1, listView.GetRows().Count);

                currentSystem = emptySystem;
                listView.SelectedEntityQuery = null;
                Assert.IsFalse(listView.ShowingSomething);
            }
        }
Beispiel #2
0
 public void EntityListView_ShowNothingWithNoEntityManager()
 {
     using (var incompleteWorld = new World("test 2"))
     {
         using (var listView = new EntityListView(new TreeViewState(), null, SetEntitySelection, () => incompleteWorld,
                                                  () => null, x => {}))
         {
             listView.SelectedEntityQuery = null;
             Assert.AreEqual(0, listView.GetRows().Count);
         }
     }
 }