Exemple #1
0
        public void StopSearching()
        {
            FriendManager  FM        = GameObject.FindObjectOfType <FriendManager>();
            PetMoveManager PMM       = GameObject.FindObjectOfType <PetMoveManager>();
            AdTest         AdManager = GameObject.FindObjectOfType <AdTest>();

            FM.UnSubScribeFriend();
            PMM.UnSubScribePet();
            FM.StopTellFriendOnline();
            AdManager.Unsubscribe();
            GameObject.FindObjectOfType <LobbyManager>().GoBackButton();
        }
Exemple #2
0
        public void OnMatchList(bool success, string extendedInfo, List <MatchInfoSnapshot> matchList)
        {
            if (!success || (matchList.Count == 0))
            {
                Debug.Log("No room now,Create New Game");
                CreateGame();
            }
            else
            {
                Debug.Log("Room Num:" + matchList.Count);
                for (int i = matchList.Count - 1; i >= 0; i--)
                {
                    Debug.Log("Current Player Num:" + matchList[i].currentSize);
                    if (matchList[i].name != "TempRoomName" + PlayerData.PlayerName)
                    {
                        if (matchList[i].name.Contains("TempRoomName") & matchList[i].currentSize == 1)
                        {
                            Debug.Log("has room,join");

                            FriendManager  FM        = GameObject.FindObjectOfType <FriendManager>();
                            PetMoveManager PMM       = GameObject.FindObjectOfType <PetMoveManager>();
                            AdTest         AdManager = GameObject.FindObjectOfType <AdTest>();
                            FM.UnSubScribeFriend();
                            PMM.UnSubScribePet();
                            FM.StopTellFriendOnline();
                            AdManager.Unsubscribe();
                            Destroy(AdManager.gameObject);

                            lobbyManager.matchMaker.JoinMatch(matchList[i].networkId, "", "", "", 0, 0, lobbyManager.OnMatchJoined);
                            return;
                        }
                        else if (matchList[i].currentSize != 1)
                        {
                            Debug.Log("Player Error:" + matchList[i].currentSize);
                        }
                    }
                    else
                    {
                        Debug.Log("ErrorRoomCatch!!!!!!!!!!!!!!!!!!!");
///						matchList[i].name = "ErrorRoom";
//						Debug.Log(matchList[i].name);
                    }
                }

                CreateGame();
                Debug.Log("Create");
                //	StartCoroutine(CheckJoinSuccess());
            }
        }
Exemple #3
0
 public void LoadLevel(string SceneName)
 {
     FM        = GameObject.FindObjectOfType <FriendManager>();
     PMM       = GameObject.FindObjectOfType <PetMoveManager>();
     AdManager = GameObject.FindObjectOfType <AdTest>();
     if (PMM != null)
     {
         PMM.UnSubScribePet();
     }
     if (FM != null)
     {
         FM.UnSubScribeFriend();
         FM.StopTellFriendOnline();
     }
     if (AdManager != null)
     {
         AdManager.Unsubscribe();
     }
     StartCoroutine(LoadAsynchronously(SceneName));
 }