Beispiel #1
0
        public virtual void Setup()
        {
            m_PreviousWorld = World.DefaultGameObjectInjectionWorld;
            DefaultWorldInitialization.Initialize("Test World", true);
            var world = World.DefaultGameObjectInjectionWorld;

            m_Manager = world.EntityManager;

            m_Container = new MockHierarchy
            {
                Strategy  = new EntityHierarchyDefaultGroupingStrategy(world),
                QueryDesc = null,
                World     = world
            };

            m_AssertHelper = new TestHierarchyHelper(m_Container.Strategy);
            EntityHierarchyDiffSystem.Register(m_Container);

            world.GetOrCreateSystem <SceneSystem>().LoadSceneAsync(m_SubScene.SceneGUID, new SceneSystem.LoadParameters
            {
                Flags = SceneLoadFlags.BlockOnImport | SceneLoadFlags.BlockOnStreamIn
            });

            world.Update();
        }
Beispiel #2
0
        public void TearDown()
        {
            EntityHierarchyDiffSystem.Unregister(m_Container);
            m_Container.Strategy.Dispose();
            m_Container.Strategy = null;
            m_AssertHelper       = null;

            m_Container.World.Dispose();
            m_Container.World = null;

            World.DefaultGameObjectInjectionWorld = m_PreviousWorld;
            m_PreviousWorld = null;
            m_Manager       = default;

            ScriptBehaviourUpdateOrder.UpdatePlayerLoop(null);

            TearDownSubScene();
        }