public override void HandleInput() { SelectionInputs selectionInput = Input.GetSelectionInput(); if (selectionInput != SelectionInputs.NoInput) { switch (selectionInput) { case SelectionInputs.Select: RegistrationLobby.OnSelectionKey(); break; case SelectionInputs.Delete: RegistrationLobby.OnDeleteKey(); break; case SelectionInputs.Up: RegistrationLobby.Selection--; break; case SelectionInputs.Down: RegistrationLobby.Selection++; break; case SelectionInputs.Left: RegistrationLobby.OnLeft(); break; case SelectionInputs.Right: RegistrationLobby.OnRight(); break; } } }
private void HandleSelectionInput() { SelectionInputs selectionInput = Input.GetSelectionInput(); if (selectionInput != SelectionInputs.NoInput) { if (selectionInput == SelectionInputs.Select) { InitializeNetwork(ConnectionLobby.ConnectOptions.Selection == 1); } else if (SessionInformation != null) { switch (selectionInput) { case SelectionInputs.Up: ConnectionLobby.ConnectOptions.Selection--; break; case SelectionInputs.Down: ConnectionLobby.ConnectOptions.Selection++; break; } } } }
private void AddPlayerToTeam(Transform _player, SelectionInputs _playerSelectionInputs) { InputPlayerAxis playerAxis = _player.GetComponent <InputPlayerAxis>(); if (_playerSelectionInputs.team == SelectionInputs.Team.Shepherd) { wolfDogDifference++; } else if (_playerSelectionInputs.team == SelectionInputs.Team.Wolf) { wolfDogDifference--; } PlayerPrefs.SetInt(playerAxis.player + " team", (int)_playerSelectionInputs.team); }
private void loadGameScene() { foreach (Transform child in transform) { SelectionInputs playerSelectionInputs = child.GetComponent <SelectionInputs>(); if (playerSelectionInputs.team == SelectionInputs.Team.None) { AddPlayerToTeam(child, playerSelectionInputs); } } music.DOFade(0, 1).OnComplete(null); LoadingScreen.TransitionTo(GameScene.SceneName, null); isStartPressed = true; }
private void HandlePlayerCountInput() { SelectionInputs selection = Input.GetSelectionInput(); switch (selection) { case SelectionInputs.Left: GameOptionLobby.PlayerCount -= 2; break; case SelectionInputs.Right: GameOptionLobby.PlayerCount += 2; break; default: break; } }
private void HandleSelectInput() { SelectionInputs selection = Input.GetSelectionInput(); switch (selection) { case SelectionInputs.Select: ApplyConfiguration(); break; case SelectionInputs.Up: GameOptionLobby.Selection--; break; case SelectionInputs.Down: GameOptionLobby.Selection++; break; default: break; } }
public void StartGame() { bool allSelected = true; foreach (Transform child in transform) { SelectionInputs playerSelectionInputs = child.GetComponent <SelectionInputs>(); if (playerSelectionInputs != null) { if (playerSelectionInputs.team != SelectionInputs.Team.None) { AddPlayerToTeam(child, playerSelectionInputs); } else { allSelected = false; break; } } } if (!allSelected && FourPlayers) { MessagePopup.DisplayMessage("Veuillez tous sélectionner un camp"); isStartPressed = false; } else { if (FourPlayers && !twoShepherdTwoWolf()) { MessagePopup.DisplayMessage("Il faut avoir 2 bergers et 2 loups pour pouvoir jouer"); } else { loadGameScene(); } } wolfDogDifference = 0; }
public Keys GetSelectionKey(SelectionInputs selection) { switch (selection) { case SelectionInputs.Select: return(Keys.Enter); case SelectionInputs.Delete: return(Keys.Delete); case SelectionInputs.Up: return(Keys.Up); case SelectionInputs.Down: return(Keys.Down); case SelectionInputs.Left: return(Keys.Left); case SelectionInputs.Right: return(Keys.Right); } return(Keys.None); }