示例#1
0
 /// <summary>
 /// Set player's playing deck and Enters the game.
 /// Player setting(Deck, ID, Avatar etc) is loaded and used in battle.
 /// </summary>
 /// <param name="newPlayer"></param>
 public override void OnPhotonPlayerConnected(PhotonPlayer newPlayer)
 {
     if (IsMaster)
     {
         if (PhotonNetwork.playerList.Length > 1)
         {
             SetLoggerAsString("Ready for game");
             string        deckName = dropDown.options[dropDown.value].text;
             PlayerProfile p        = FileBridge.LoadProfile();
             if (p != null)
             {
                 Debug.Log("Set Deck To Play");
                 p.SetDeckToPlay(deckName);
                 FileBridge.SaveProfile(p);
                 FileBridge.UpdateAsset(p);
             }
             else
             {
                 Debug.LogError("OnPhtonPlayerConnected: Can'tFindPlayer");
             }
             loggerUpdated.Raise();
             PhotonNetwork.room.IsOpen = false;
             PhotonNetwork.Instantiate("Multiplay Manager", Vector3.zero, Quaternion.identity, 0);
         }
     }
 }