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();
    }
コード例 #2
0
 void Start()
 {
     PopupManager.SetUpPopupManager();
     TileInformation.SetUpTileInformation();
     TileManager.SetUpTiles();
     CardInformation.SetUpCardInformation();
     CardManager.SetUpCardManager();
     PlayerManager.PlacePlayersOnBoard();
     PlayerInformationManager.SetUpPlayerInformationManager(PlayerManager.GetPlayers().Length);
     GameLoop.SetUpGameLoop();
 }
コード例 #3
0
    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();
    }
コード例 #4
0
 public override void DoCardAction()
 {
     GameLoop.GetCurrentPlayer().ChangeGetOutOfJailCard(true);
     PlayerInformationManager.UpdatePlayerInfo();
 }
コード例 #5
0
 public virtual void Buy()
 {
     GameLoop.GetCurrentPlayer().Charge(PurchasePrice);
     Owner = GameLoop.GetCurrentPlayer();
     PlayerInformationManager.UpdatePlayerInfo();
 }
コード例 #6
0
 public void Pay(int income)
 {
     money = money + income;
     PlayerInformationManager.UpdatePlayerInfo();
 }
コード例 #7
0
 public void GetOutOfJail()
 {
     inJail = false;
     PlayerInformationManager.UpdatePlayerInfo();
 }