From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- Client/Assets/Scripts/XMainClient/XRollDocument.cs | 95 ++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/XRollDocument.cs (limited to 'Client/Assets/Scripts/XMainClient/XRollDocument.cs') diff --git a/Client/Assets/Scripts/XMainClient/XRollDocument.cs b/Client/Assets/Scripts/XMainClient/XRollDocument.cs new file mode 100644 index 00000000..36032d2a --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/XRollDocument.cs @@ -0,0 +1,95 @@ +using System; +using KKSG; +using UnityEngine; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XRollDocument : XDocComponent + { + public override uint ID + { + get + { + return XRollDocument.uuID; + } + } + + public uint RollItemID + { + get + { + bool flag = this._current_roll_info == null; + uint result; + if (flag) + { + result = 0u; + } + else + { + result = this._current_roll_info.id; + } + return result; + } + } + + public uint RollItemCount + { + get + { + bool flag = this._current_roll_info == null; + uint result; + if (flag) + { + result = 0u; + } + else + { + result = this._current_roll_info.count; + } + return result; + } + } + + public float LastRollTime + { + get + { + return this._last_roll_time; + } + } + + public new static readonly uint uuID = XSingleton.singleton.XHash("RollDocument"); + + private EnemyDoodadInfo _current_roll_info; + + public int ClientRollTime = 0; + + private float _last_roll_time = 0f; + + public void SendRollReq(int type) + { + RpcC2G_ChooseRollReq rpcC2G_ChooseRollReq = new RpcC2G_ChooseRollReq(); + rpcC2G_ChooseRollReq.oArg.info = this._current_roll_info; + rpcC2G_ChooseRollReq.oArg.chooseType = type; + XSingleton.singleton.Send(rpcC2G_ChooseRollReq); + } + + public void SetRollItem(EnemyDoodadInfo info) + { + bool flag = this.ClientRollTime == 0; + if (flag) + { + this.ClientRollTime = XSingleton.singleton.GetInt("ClientRollTime"); + } + this._last_roll_time = Time.time; + this._current_roll_info = info; + DlgBase.singleton.ShowRollInfo(); + } + + protected override void OnReconnected(XReconnectedEventArgs arg) + { + } + } +} -- cgit v1.1-26-g67d0