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); }
private void Awake() { mWorldContext = new WorldContextFactory().CreateNewWorldInstance(); mSystemManager = new SystemManager(mWorldContext); WorldContextsManagerUtils.CreateWorldContextManager(mWorldContext, "WorldContextManager_System"); SystemManagerObserverUtils.CreateSystemManagerObserver(mSystemManager, "SystemManagerObserver_System"); mSystemManager.Init(); }
public void Init() { mWorldContext = new WorldContextFactory().CreateNewWorldInstance(); mSystemManager = new SystemManager(mWorldContext); mRegisterViewsSystem = new RegisterViewSystem(mWorldContext); mSystemManager.RegisterSystem(mRegisterViewsSystem); mSystemManager.Init(); }
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(); }
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(); }