public void Movement(Player player) { var mouseUI = player.mouseUI.GetComponent <MouseUI>(); _gameSceneManager.numberOfMoves -= 1; _gameSceneManager.numberOfMovesThisTurn += 1; if (_gameSceneManager.numberOfMoves == 0) { _mouse.Clear(mouseUI); player.isAbleToMove = false; } _gameSceneManager.SetAbilityButtons(); }
public void Enter(Player player) { Debug.Log(player.name + " entered build state!"); var mouseUI = player.mouseUI.GetComponent <MouseUI>(); _mouse.Clear(mouseUI); drewBuildSuggestions = false; }
public void Enter(Player player) { if (player != null) { Debug.Log(player.name + " entered waiting state!"); var mouseUI = player.mouseUI.GetComponent <MouseUI>(); _mouse.Clear(mouseUI); } }
public void Enter(Player player) { Debug.Log(player.name + " entered attack state!"); var mouseUI = player.mouseUI.GetComponent <MouseUI>(); _mouse.Clear(mouseUI); _mouse.SetAttackCursor(mouseUI); drewAttackSuggestions = false; }
private void ClearCurrentPlayer() { CurrentPlayer().money += CurrentPlayer().income; var mouseUI = CurrentPlayer().mouseUI.GetComponent <MouseUI>(); _mouse.Clear(mouseUI); CurrentPlayer().OnPlayerMovement -= OnPlayerMovement; CurrentPlayer().ChangeState(typeof(IPlayerWaitingTurnState)); }
public void Enter(Player player) { Debug.Log(player.name + " entering move state"); LoadPlayersFogOfWar(player); var mouseUI = player.mouseUI.GetComponent <MouseUI>(); _mouse.Clear(mouseUI); drewMouseSuggestions = false; _gameMap.CheckAndHideGameEntities(player); _playerFogOfWar.ChangeFogOfWar(player, player.revealAlphaLevel); _playerFogOfWar.RevealPlayersRefineries(player); }
public IEnumerator Move(Player player) { PlayMoveSoundEffect(); var mouseUI = player.mouseUI.GetComponent <MouseUI>(); _mouse.Clear(mouseUI); _playerFogOfWar.ChangeFogOfWar(player, player.visitedAlphaLevel); _playerFogOfWar.RevealPlayersRefineries(player); player._isMoving = true; var startPos = player.transform.position; var t = 0f; var endPos = new Vector3(GetMousePos(player).x, GetMousePos(player).y, startPos.z); while (player.transform.position != endPos) { t += Time.deltaTime * player.moveSpeed; player.transform.position = Vector3.Lerp(startPos, endPos, t); yield return(null); } _playerFogOfWar.ChangeFogOfWar(player, player.revealAlphaLevel); player._isMoving = false; AddAllTilesOf(player); _playerMoney.CheckIfOnMoney(player); _gameMap.CheckAndHideGameEntities(player); // check if more moves are available if (_gameSceneManager.numberOfMoves > 0) { _mouse.DrawMoveSuggestions(player); } yield return(0); }