示例#1
0
 public void Run()
 {
     stateManager.Start(gameStates[Mode.Regular]);
     stateManager.ChangeState(gameStates[Mode.Build]);
     signalBus.Publish <SwitchGameModeSignal>(gameModeSignals[Mode.Build]);
     signalBus.Subscribe <SwitchGameModeSignal>(SwitchMode);
 }
示例#2
0
        private void SwitchMode()
        {
            switch (gameMode.CurrentMode)
            {
            case Mode.Build:
                signalBus.Publish <SwitchGameModeSignal>(regularGameSignal);
                break;

            case Mode.Regular:
                signalBus.Publish <SwitchGameModeSignal>(buildGameSignal);
                break;
            }
        }
        private void SendUpdateSignal()
        {
            var resources = new ResourcesData()
            {
                Gold  = Gold,
                Steel = Steel,
                Wood  = Wood
            };

            signalBus.Publish <UpdateResourcesSignal>(new UpdateResourcesSignal(resources));
        }
 private void AddResources()
 {
     signalBus.Publish <TryAddResourceSignal>(new TryAddResourceSignal(data.Production.Quantity));
 }