From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../Scripts/XMainClient/XCommandGenericClick.cs | 48 ++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/XCommandGenericClick.cs (limited to 'Client/Assets/Scripts/XMainClient/XCommandGenericClick.cs') diff --git a/Client/Assets/Scripts/XMainClient/XCommandGenericClick.cs b/Client/Assets/Scripts/XMainClient/XCommandGenericClick.cs new file mode 100644 index 00000000..1321c577 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/XCommandGenericClick.cs @@ -0,0 +1,48 @@ +using System; +using UnityEngine; +using XMainClient.UI; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XCommandGenericClick : XBaseCommand + { + private GameObject _finger; + + public override bool Execute() + { + bool flag = this._finger == null; + if (flag) + { + this._finger = (XSingleton.singleton.CreateFromPrefab("UI/Common/Quan", true, false) as GameObject); + } + base.SetOverlay(); + XSingleton.singleton.AddChild(XSingleton.singleton.UIRoot, XBaseCommand._Overlay.transform); + int num = int.Parse(this._cmd.param1); + int num2 = int.Parse(this._cmd.param2); + Vector3 vector = XSingleton.singleton.UICamera.ScreenToWorldPoint(XTutorialHelper.BaseScreenPos2Real(new Vector2((float)num, (float)num2))); + Vector3 localPosition = XBaseCommand._Overlay.transform.InverseTransformPoint(vector); + XSingleton.singleton.AddChild(XBaseCommand._Overlay.transform, this._finger.transform); + localPosition.z = 0f; + this._finger.transform.localPosition = localPosition; + XSingleton.singleton.Exculsive = true; + XSingleton.singleton.ExculsiveOnGeneric = true; + base.SetTutorialText(this._cmd.textPos, this._finger.transform); + base.publicModule(); + return true; + } + + public override void OnFinish() + { + this.Stop(); + } + + public override void Stop() + { + XSingleton.singleton.Exculsive = false; + XSingleton.singleton.ExculsiveOnGeneric = false; + XResourceLoaderMgr.SafeDestroy(ref this._finger, false); + base.Stop(); + } + } +} -- cgit v1.1-26-g67d0