using UnityEngine; namespace DanieleMarotta.RiversongCodeShowcase { [RequiresWorldReadyForUpdate] public class DemoSystem : GameSystem, IUpdatable { [InjectService] private ISignalBus _signalBus; [InjectService] private GameConfig _config; [InjectService] private World _world; private bool _demoCompleted; private float _gameTime; public DemoSystem(IServiceLocator serviceLocator) : base(serviceLocator) { } public void Update() { if (_demoCompleted) return; _gameTime += Time.unscaledDeltaTime; var populationState = _world.PopulationState; var generalSettings = _config.GeneralSettings; if (populationState.Population < generalSettings.PopulationGoal || populationState.Happiness < generalSettings.HappinessGoal) return; _demoCompleted = true; _signalBus.Raise(new DemoCompletedSignal(_gameTime)); } } }