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; } }
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); }
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); }