Exemplo n.º 1
0
 /// 创建游戏大厅
 public void CreateLobby()
 {
     if (Lobby != null)
     {
         return;
     }
     Lobby = ResourceManager.Instance.Load <LobbyItem>("Prefabs/Lobby.prefab");
     Lobby.transform.SetParent(UICanvas.transform, false);
 }
Exemplo n.º 2
0
 /// <summary>
 /// Sets the values of this component based on this input.
 /// </summary>
 /// <param name="sceneItem">LobbyItem type, Extracts the photon room name from this</param>
 public virtual void AddAvailableScene(LobbyItem sceneItem)
 {
     scenes.Add(sceneItem);
     if (scenes.Count == 1)
     {
         roomJoinName = sceneItem.rawRoomName;
         if (string.IsNullOrEmpty(sceneItem.sceneName) || sceneItem.sceneName.Contains("Lobby"))
         {
             indexToLoad = database.storedScenesData.Find(x => x.index == FindObjectOfType <ExampleUI>().lobbyIndex).index;
         }
         else
         {
             indexToLoad = database.storedScenesData.Find(x => x.sceneName == sceneItem.sceneName).index;
         }
         SetValues(scenes[0].displayName, scenes[0].playerCount, scenes[0].isVisible, scenes[0].rawRoomName);
     }
     SetTotalPlayerCount();
 }