Beispiel #1
0
 public void updateState(CommonDefine.PLAYER_STATE state)
 {
     // 这里只处理用户上线(游戏中)和离线
     if (state == CommonDefine.PLAYER_STATE.STATE_TYPE_OFFLINE)
     {
         _head.interactable = false;
     }
     else if (state == CommonDefine.PLAYER_STATE.STATE_TYPE_PLAYING)
     {
         _head.interactable = true;
     }
 }
Beispiel #2
0
 public static bool updatePlayerStateBySeat(int seat, CommonDefine.PLAYER_STATE state)
 {
     for (int i = 0; i < playerList.Count; i++)
     {
         if (playerList[i].seat == seat)
         {
             Player p = playerList[i];
             p.state       = state;
             playerList[i] = p;
             return(true);
         }
     }
     return(false);
 }
Beispiel #3
0
 public static bool updatePlayerStateByUserID(int userID, CommonDefine.PLAYER_STATE state)
 {
     for (int i = 0; i < playerList.Count; i++)
     {
         if (playerList[i].userID == userID)
         {
             Player p = playerList[i];
             p.state       = state;
             playerList[i] = p;
             return(true);
         }
     }
     return(false);
 }