public void RegisterComponent(GameCommandsHelper helper) { if (!helper) { return; } helper.UpdateAsObservable() .Subscribe(_ => CheckForButtons(helper)) .AddTo(helper); }
private void CheckForButtons(GameCommandsHelper helper) { if (helper.EndGameButton.WasPressed()) { MessageBroker.Default.Publish(new GameCloseArgs()); } if (helper.StartGameButton.WasPressed()) { MessageBroker.Default.Publish(new GameStartArgs()); } if (helper.ResetRoomButton.WasPressed()) { MessageBroker.Default.Publish(new RoomRotationResetArgs()); } if (helper.MuteMusicButton.WasPressed()) { MessageBroker.Default.Publish(new ChangeMusicArgs()); } }