From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../Assets/Scripts/XMainClient/UI/PressTipsDlg.cs | 90 ++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/UI/PressTipsDlg.cs (limited to 'Client/Assets/Scripts/XMainClient/UI/PressTipsDlg.cs') diff --git a/Client/Assets/Scripts/XMainClient/UI/PressTipsDlg.cs b/Client/Assets/Scripts/XMainClient/UI/PressTipsDlg.cs new file mode 100644 index 00000000..af9a5581 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/UI/PressTipsDlg.cs @@ -0,0 +1,90 @@ +using System; +using UnityEngine; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient.UI +{ + internal class PressTipsDlg : DlgBase + { + public override string fileName + { + get + { + return "Common/PressTipDlg"; + } + } + + public override bool isHideChat + { + get + { + return false; + } + } + + private string _contentKey; + + private Vector3 _offset; + + private Vector3 _pos; + + public void Setup(bool show, string key, Vector3 pos, Vector3 offset) + { + if (show) + { + this._contentKey = key; + this._offset = offset; + this._pos = pos; + bool flag = !base.IsVisible(); + if (flag) + { + this._Show(); + } + else + { + this.RefreshData(); + } + } + else + { + bool flag2 = base.IsVisible(); + if (flag2) + { + this._Close(); + } + } + } + + protected override void OnShow() + { + base.OnShow(); + this.RefreshData(); + } + + private void RefreshData() + { + bool flag = string.IsNullOrEmpty(this._contentKey); + if (flag) + { + this._Close(); + } + else + { + base.uiBehaviour.transform.position = this._pos; + base.uiBehaviour.transform.localPosition += this._offset; + base.uiBehaviour._ContentValue.SetText(XSingleton.singleton.ReplaceReturn(XStringDefineProxy.GetString(this._contentKey))); + } + } + + private void _Close() + { + this.SetVisibleWithAnimation(false, null); + } + + private void _Show() + { + this.SetVisibleWithAnimation(true, null); + } + } +} -- cgit v1.1-26-g67d0