namespace ET.Client { public static class RoomPushHandleHelper { // 加入房间推送协程 public static async ETTask JoinRoomPushTo(Scene clientScene, RoomInfo roomInfo) { var startFightRoomComponment = clientScene.GetComponent(); if (startFightRoomComponment == null) { startFightRoomComponment = clientScene.AddComponent(); } startFightRoomComponment.ClearStartFightRoomInfo(); await startFightRoomComponment.SetStartFightRoomInfoFromPush(roomInfo); EventSystem.Instance.Publish(clientScene, new EventType.JoinRoomPush()); } //准备推送 public static async ETTask ReadyPushTo(Scene clientScene, RoomInfo roomInfo) { var startFightRoomComponment = clientScene.GetComponent(); if (startFightRoomComponment == null) { startFightRoomComponment = clientScene.AddComponent(); } startFightRoomComponment.ClearStartFightRoomInfo(); await startFightRoomComponment.SetStartFightRoomInfoFromPush(roomInfo); EventSystem.Instance.Publish(clientScene, new EventType.ReadyPush()); } // T人推送协程 public static async ETTask KickPushTo(Scene clientScene, RoomInfo roomInfo) { var startFightRoomComponment = clientScene.GetComponent(); if (startFightRoomComponment == null) { startFightRoomComponment = clientScene.AddComponent(); } startFightRoomComponment.ClearStartFightRoomInfo(); await startFightRoomComponment.SetStartFightRoomInfoFromPush(roomInfo); EventSystem.Instance.Publish(clientScene, new EventType.KickPush()); } //都准备好了 推送开始倒计时 public static async ETTask ReadyStartPushTo(Scene clientScene, long readyStartTime) { var startFightRoomComponment = clientScene.GetComponent(); if (startFightRoomComponment == null) { startFightRoomComponment = clientScene.AddComponent(); } await startFightRoomComponment.SetReadyTimeCount(readyStartTime); EventSystem.Instance.Publish(clientScene, new EventType.ReadyStartPush()); } //正式开始 推送发牌 public static async ETTask GameStartPushTo(Scene clientScene, RoomInfo roomInfo) { var startFightRoomComponment = clientScene.GetComponent(); if (startFightRoomComponment == null) { startFightRoomComponment = clientScene.AddComponent(); } startFightRoomComponment.ClearStartFightRoomInfo(); await startFightRoomComponment.SetStartFightRoomInfoFromPush(roomInfo); EventSystem.Instance.Publish(clientScene, new EventType.GameStartPush()); } //玩家摸牌 public static async ETTask GameDrawCardPushTo(Scene clientScene, RoomInfo roomInfo) { var startFightRoomComponment = clientScene.GetComponent(); if (startFightRoomComponment == null) { startFightRoomComponment = clientScene.AddComponent(); } startFightRoomComponment.ClearStartFightRoomInfo(); await startFightRoomComponment.SetStartFightRoomInfoFromPush(roomInfo); EventSystem.Instance.Publish(clientScene, new EventType.GameDrawCardPush()); } //玩家出牌 public static async ETTask GameDisCardPushTo(Scene clientScene, RoomInfo roomInfo) { var startFightRoomComponment = clientScene.GetComponent(); if (startFightRoomComponment == null) { startFightRoomComponment = clientScene.AddComponent(); } startFightRoomComponment.ClearStartFightRoomInfo(); await startFightRoomComponment.SetStartFightRoomInfoFromPush(roomInfo); EventSystem.Instance.Publish(clientScene, new EventType.GameDisCardPush()); } //操作推送 public static async ETTask OperationPushTo(Scene clientScene, G2C_HGHHOperationPush msg) { var startFightRoomComponment = clientScene.GetComponent(); if (startFightRoomComponment == null) { startFightRoomComponment = clientScene.AddComponent(); } startFightRoomComponment.ClearStartFightRoomInfo(); startFightRoomComponment.SetOperatorOpType(msg.OpType); await startFightRoomComponment.SetStartFightRoomInfoFromPush(msg.info); EventSystem.Instance.Publish(clientScene, new EventType.GameOperationPush()); } //操作推送 public static async ETTask HGHHSettlementPushTo(Scene clientScene, G2C_HGHHSettlementPush msg) { var startFightRoomComponment = clientScene.GetComponent(); if (startFightRoomComponment == null) { startFightRoomComponment = clientScene.AddComponent(); } startFightRoomComponment.ClearStartFightRoomInfo(); await startFightRoomComponment.SetSettlementFromPush(msg.CurRound, msg.PlayerInfo); EventSystem.Instance.Publish(clientScene, new EventType.HGHHSettlementPush()); } } }