Ejemplo n.º 1
0
        public void TestDisposableEntitiesCollectorSystem_ThereAreNoDisposableEntitiesAtInput_DoNothing()
        {
            mSystemManager.RegisterSystem(new PureUpdateSystemAdapter(mWorldContext, BuiltinSystems.DisposableEntitiesCollectorSystem));

            int expectedNumOfDisposableEntities = 5;

            for (int i = 0; i < expectedNumOfDisposableEntities; ++i)
            {
                mWorldContext.CreateDisposableEntity();
            }

            Assert.AreEqual(expectedNumOfDisposableEntities, mWorldContext.GetEntitiesWithAll(typeof(TDisposableComponent)).Count);

            mSystemManager.Init();
            mSystemManager.Update(0.0f);

            Assert.AreEqual(0, mWorldContext.GetEntitiesWithAll(typeof(TDisposableComponent)).Count);
        }
Ejemplo n.º 2
0
    private void Awake()
    {
        mWorldContext = new WorldContextFactory().CreateNewWorldInstance();

        mSystemManager = new SystemManager(mWorldContext);

        WorldContextsManagerUtils.CreateWorldContextManager(mWorldContext, "WorldContextManager_System");
        SystemManagerObserverUtils.CreateSystemManagerObserver(mSystemManager, "SystemManagerObserver_System");

        mSystemManager.Init();
    }
Ejemplo n.º 3
0
        public void Init()
        {
            mWorldContext = new WorldContextFactory().CreateNewWorldInstance();

            mSystemManager = new SystemManager(mWorldContext);

            mRegisterViewsSystem = new RegisterViewSystem(mWorldContext);

            mSystemManager.RegisterSystem(mRegisterViewsSystem);

            mSystemManager.Init();
        }
Ejemplo n.º 4
0
    protected void Awake()
    {
        mWorldContext = new WorldContextFactory().CreateNewWorldInstance();

        mSystemManager = new SystemManager(mWorldContext);

        WorldContextsManagerUtils.CreateWorldContextManager(mWorldContext, "WorldsContextsManager_System");
        SystemManagerObserverUtils.CreateSystemManagerObserver(mSystemManager, "SystemManagerObserver_System");

        mSystemManager.RegisterSystem(new RegisterViewSystem(mWorldContext));

        mSystemManager.Init();
    }
Ejemplo n.º 5
0
    private void Awake()
    {
        mWorldContext = new WorldContextFactory().CreateNewWorldInstance();

        mSystemManager = new SystemManager(mWorldContext);

        WorldContextsManagerUtils.CreateWorldContextManager(mWorldContext, "WorldContextManager_System");
        SystemManagerObserverUtils.CreateSystemManagerObserver(mSystemManager, "SystemManagerObserver_System");

        // register our systems here
        mSystemManager.RegisterUpdateSystem(new InputSystem(mWorldContext, Camera.main));
        mSystemManager.RegisterReactiveSystem(new ImprovedSpawnSystem(mWorldContext, mPrefab, new GameObjectFactory(mWorldContext)));
        mSystemManager.RegisterReactiveSystem(new RegisterViewSystem(mWorldContext));
        mSystemManager.RegisterUpdateSystem(new RotatingCubesSystem(mWorldContext));

        mSystemManager.Init();
    }