Esempio n. 1
0
        public void OnStartButtonClicked()
        {
            var launcher = RoomLauncher.Instance;
            var room     = PhotonNetwork.CurrentRoom;

            if (room.PlayerCount < room.MaxPlayers)
            {
                Debug.Log("Not enough players");
                warningPanel.Show(400, 200, "Not enough players.");
                return;
            }

            if (CheckReadiness())
            {
                Debug.Log("Game is starting");
                var setting = (GameSetting)room.CustomProperties[SettingKeys.SETTING];
                SaveSettings(setting);
                launcher.GameStart();
            }
            else
            {
                Debug.Log("Game cannot start, since some players are not ready");
                warningPanel.Show(400, 200, "Game cannot start, some players are not ready.");
            }
        }
Esempio n. 2
0
        public void OnStartButtonClicked()
        {
            var launcher = RoomLauncher.Instance;
            var room     = PhotonNetwork.CurrentRoom;

            if (room.PlayerCount < room.MaxPlayers)
            {
                Debug.Log("Not enough players");
                warningPanel.Show(400, 200, "Not enough players.");
                return;
            }
            Debug.Log("Requesting game start");
            launcher.GameStart();
        }