1
This commit is contained in:
@@ -113,8 +113,22 @@ namespace Assets.MyGame.Scripts.Net
|
||||
|
||||
break;
|
||||
case "ReadyNotice":
|
||||
//roomMainPanel.subUIManager.CloseAll();
|
||||
roomMainPanel.InitRoomData();
|
||||
{
|
||||
// ReadyNotice arguments[0] 是用户ID字符串,不是房间对象
|
||||
var userId = JsonConvert.DeserializeObject<WebSocketResponseBase<string>>(msg).arguments[0];
|
||||
// 标记该玩家已准备
|
||||
if (roomMainPanel.roomData != null && roomMainPanel.roomData.users != null)
|
||||
{
|
||||
var u = roomMainPanel.roomData.users.Find(x => x.userId == userId);
|
||||
if (u != null) u.isReady = true;
|
||||
// 只有双方都准备好才进入游戏
|
||||
if (roomMainPanel.roomData.users.Count >= 2
|
||||
&& roomMainPanel.roomData.users.TrueForAll(x => x.isReady))
|
||||
{
|
||||
roomMainPanel.InitRoomData();
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "GameOperation":
|
||||
{
|
||||
|
||||
@@ -156,6 +156,13 @@ namespace Assets.MyGame.Scripts.Net
|
||||
}
|
||||
public static void RoomKillNotice(string msg)
|
||||
{
|
||||
// 离开倒计时期间不触发击杀/爆奖特效
|
||||
var panel = UIManager.Instance.Get<GameMainPanel_FishBase>(UIPanel.MainGamePanelDefault)
|
||||
?? UIManager.Instance.Get<GameMainPanel_FishBase>(UIPanel.MainGamePanelFLZY)
|
||||
?? UIManager.Instance.Get<GameMainPanel_FishBase>(UIPanel.MainGamePanelYYSC)
|
||||
?? UIManager.Instance.Get<GameMainPanel_FishBase>(UIPanel.MainGamePanelXJMH)
|
||||
?? UIManager.Instance.Get<GameMainPanel_FishBase>(UIPanel.MainGamePanelHHWK);
|
||||
if (panel != null && panel.IsLeavingCountdown()) return;
|
||||
CreateFishManager.Instance.Ws_DieFish(msg);
|
||||
}
|
||||
public static void RoomFireNotice(string msg)
|
||||
|
||||
Reference in New Issue
Block a user