Exemple #1
0
        public void OnEvent(ExitGames.Client.Photon.EventData photonEvent)
        {
            byte eventCode = photonEvent.Code;

            Debug.Log(eventCode);
            if (eventCode == 0)
            {
                readyCheck++;
                if (readyCheck == NetworkedManager.GetNumberOfLivePlayers())
                {
                    PhotonView pv = gameObject.GetComponent <PhotonView>();
                    pv.RPC("RPC_StartGame", RpcTarget.AllViaServer);
                    PhotonNetwork.NetworkingClient.EventReceived -= OnEvent;
                }
            }
        }
Exemple #2
0
        void Awake()
        {
            numPlayers = NetworkedManager.GetNumberOfPlayers();
            if (PhotonNetwork.IsMasterClient)
            {
                PhotonNetwork.NetworkingClient.EventReceived += OnEvent;
            }
            boardState.SetCap(boardWidth);

            boardState.SetGaps();
            this.tileWidth  = boardState.GetTileWidth();
            this.tileLength = boardState.GetTileLength();

            CreatePlayers();
            CreateBases();
            string shape = numPlayers <= 2 ? "rhombus" : "hexagon";

            CreateBoard(shape);
            resource.InitResourceTiles(boardState.GetBases(), baseOffset, boardWidth, numPlayers);

            StartCoroutine(SetBoard());
        }
Exemple #3
0
 void Start()
 {
     Instance = this;
 }