public void Update() { if (this.world == null) { // Initialize world with 0.033 time step WorldUtilities.CreateWorld <TState>(ref this.world, 0.033f); { #if FPS_MODULE_SUPPORT this.world.AddModule <FPSModule>(); #endif this.world.AddModule <StatesHistoryModule>(); this.world.AddModule <NetworkModule>(); // Add your custom modules here // Create new state this.world.SetState <TState>(WorldUtilities.CreateState <TState>()); ComponentsInitializer.DoInit(); this.Initialize(this.world); // Add your custom systems here } // Save initialization state this.world.SaveResetState <TState>(); } if (this.world != null) { var dt = Time.deltaTime; this.world.PreUpdate(dt); this.world.Update(dt); } }
private void CreateWorld() { // Initialize world with 0.033 time step WorldUtilities.CreateWorld <TState>(ref _world, 0.033f); { #if FPS_MODULE_SUPPORT this.world.AddModule <FPSModule>(); #endif _world.AddModule <StatesHistoryModule>(); _world.AddModule <NetworkModule>(); // Add your custom modules here // Create new state _world.SetState <TState>(WorldUtilities.CreateState <TState>()); ComponentsInitializer.DoInit(); Initialize(_world); _world.SetSeed((uint)1); // Add your custom systems here } // Save initialization state _world.SaveResetState <TState>(); }