public static void SetUpPlayerInformationManager(int incomingNumberOfPlayers) { _playerInformationManager = GameObject.Find("PlayerInformationCanvas").GetComponent <PlayerInformationManager>(); _playerInformationManager._numberOfPlayers = incomingNumberOfPlayers; _playerInformationManager._playerInfoGameObjects = new GameObject[8]; _playerInformationManager._moneyTexts = new Text[incomingNumberOfPlayers]; _playerInformationManager._inJailTexts = new Text[incomingNumberOfPlayers]; _playerInformationManager._jailCardTexts = new Text[incomingNumberOfPlayers]; for (int n = 0; n < 8; n++) { Debug.Log(n); _playerInformationManager._playerInfoGameObjects[n] = GameObject.Find("Player" + (n + 1) + "Info"); } for (int n = incomingNumberOfPlayers; n < 8; n++) { _playerInformationManager._playerInfoGameObjects[n].SetActive(false); } for (int n = 0; n < incomingNumberOfPlayers; n++) { _playerInformationManager._moneyTexts[n] = _playerInformationManager._playerInfoGameObjects[n].transform.Find("Money").GetComponent <Text>(); _playerInformationManager._inJailTexts[n] = _playerInformationManager._playerInfoGameObjects[n].transform.Find("InJail").GetComponent <Text>(); _playerInformationManager._jailCardTexts[n] = _playerInformationManager._playerInfoGameObjects[n].transform.Find("GetOutOfJailCard").GetComponent <Text>(); } UpdatePlayerInfo(); }
void Start() { PopupManager.SetUpPopupManager(); TileInformation.SetUpTileInformation(); TileManager.SetUpTiles(); CardInformation.SetUpCardInformation(); CardManager.SetUpCardManager(); PlayerManager.PlacePlayersOnBoard(); PlayerInformationManager.SetUpPlayerInformationManager(PlayerManager.GetPlayers().Length); GameLoop.SetUpGameLoop(); }
public IEnumerator GoToJailCoroutine() //send to jail, RIGHT THROUGH BOARD, DO NOT PASS OTHER TILES { Vector3 finalPosition = TileManager.GetTile(10).GetTilePosition(); while (currentPosition != finalPosition) { currentPosition = Vector3.MoveTowards(currentPosition, finalPosition, 20f); { UpdatePosition(); yield return(null); } } currentWaypoint = 10; inJail = true; PlayerInformationManager.UpdatePlayerInfo(); GameLoop.EndTurn(); }
public override void DoCardAction() { GameLoop.GetCurrentPlayer().ChangeGetOutOfJailCard(true); PlayerInformationManager.UpdatePlayerInfo(); }
public virtual void Buy() { GameLoop.GetCurrentPlayer().Charge(PurchasePrice); Owner = GameLoop.GetCurrentPlayer(); PlayerInformationManager.UpdatePlayerInfo(); }
public void Pay(int income) { money = money + income; PlayerInformationManager.UpdatePlayerInfo(); }
public void GetOutOfJail() { inJail = false; PlayerInformationManager.UpdatePlayerInfo(); }