Example #1
0
        public void SetUpSeat(int playerSlotIndex)
        { // the RPC part of the setup where we enable the coin counter and nameplate for each player
            PlayerSlot seat = GameMaster.Instance.playerSlots[playerSlotIndex].GetComponent <PlayerSlot>();

            seat.coinCounter.gameObject.SetActive(true);
            seat.namePlate.gameObject.SetActive(true);
            seat.namePlate.text = seat.GetComponent <PhotonView>().Controller.NickName;
        }
Example #2
0
        private void FindSlot(bool claimSlot)
        { // this is what gets us our player seat at the start
            for (int i = 0; i < PhotonNetwork.CurrentRoom.PlayerCount; i++)
            {
                if (PhotonNetwork.PlayerList[i].Equals(pv.Controller))
                {
                    playerNumber = i;
                }
            }

            PhotonView slot = GameMaster.Instance.playerSlots[playerNumber];

            if (claimSlot)
            {
                slot.TransferOwnership(pv.Controller);
            }
            mySlot        = slot.GetComponent <PlayerSlot>();
            mySlot.player = this;
            GameMaster.Instance.remainingPlayers++;
        }