void SelectGameMode() { int realNbOfPlayers = currentIndex + 2; //set the numebr of players in this game GameController.SetNumberOfPlayers(realNbOfPlayers); menuNav.StartGame(); level.SpawnPlayers(realNbOfPlayers); currentIndex = 0; selectionBox.position = selections[currentIndex].position; }
void Start() { menuNavigation = IoC.Resolve <MenuNavigation>(); Observable.EveryUpdate() .Where(x => KeyCode.R.IsPressed()) .Take(1) .Subscribe(x => menuNavigation.StartGame()) .AddTo(this); Observable.EveryUpdate() .Where(x => KeyCode.Escape.IsPressed()) .Take(1) .Subscribe(x => { Cursor.visible = true; Cursor.lockState = CursorLockMode.None; menuNavigation.NavigateToMainMenu(); }) .AddTo(this); }
private void StartGame() { menuNavigation.StartGame(); }