Beispiel #1
0
        public override void OnLobbyDataUpdated(GalaxyID lobbyID, GalaxyID memberID)
        {
            Debug.Log("LobbyID: " + lobbyID + "\nMemberID: " + memberID);
            if (memberID.IsValid())
            {
                if (matchmaking.IsCurrentUserLobbyOwner())
                {
                    matchmaking.SetLobbyData(lobbyID, "state", AllMembersReady(lobbyID) ? "ready" : "notReady");
                }
                return;
            }

            GameObject.Find("OnlineWaitScreen").GetComponent <OnlineWaitController>().startGameButton.GetComponent <Button>().
            interactable = (matchmaking.GetLobbyData(lobbyID, "state") == "ready" &&
                            matchmaking.IsCurrentUserLobbyOwner());

            if (matchmaking.GetLobbyData(lobbyID, "state") == "steady")
            {
                Debug.Assert(matchmaking.GetLobbyMemberData(GalaxyManager.Instance.MyGalaxyID, "state") == "ready");
                matchmaking.SetLobbyMemberData("state", "steady");
                friends.SetRichPresence("connect", null);
                matchmaking.LobbyManagmentMainMenuListenersDispose();
                matchmaking.LobbyManagmentInGameListenersInit();
                SceneController.Instance.LoadScene(SceneController.SceneName.Online2PlayerGame, true);
            }
        }
 void LobbyDataUpdatedReady(GalaxyID lobbyID)
 {
     if (matchmaking.GetLobbyData(lobbyID, "state") == "ready" && GalaxyManager.Instance.MyGalaxyID == matchmaking.LobbyOwnerID)
     {
         GameObject.Find("OnlineWaitScreen").GetComponent <OnlineWaitController>().startGameButton.GetComponent <Button>().interactable = true;
     }
     else
     {
         GameObject.Find("OnlineWaitScreen").GetComponent <OnlineWaitController>().startGameButton.GetComponent <Button>().interactable = false;
     }
 }
Beispiel #3
0
 public override void OnLobbyDataUpdated(GalaxyID lobbyID, GalaxyID memberID)
 {
     Debug.Log("LobbyID: " + lobbyID + "\nMemberID: " + memberID);
     if (memberID.IsValid())
     {
         if (AllMembersGo(lobbyID) && matchmaking.IsCurrentUserLobbyOwner())
         {
             matchmaking.SetLobbyData(lobbyID, "state", "go");
         }
         return;
     }
     if (matchmaking.GetLobbyData(lobbyID, "state") == "go")
     {
         GameObject.Find("GameManager").GetComponent <Online2PlayerGameManager>().enabled = true;
         GameObject.Find("PopUps").GetComponent <PopUps>().ClosePopUps();
     }
 }