From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../Scripts/XMainClient/XCommandNoforceClick.cs | 171 +++++++++++++++++++++ 1 file changed, 171 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/XCommandNoforceClick.cs (limited to 'Client/Assets/Scripts/XMainClient/XCommandNoforceClick.cs') diff --git a/Client/Assets/Scripts/XMainClient/XCommandNoforceClick.cs b/Client/Assets/Scripts/XMainClient/XCommandNoforceClick.cs new file mode 100644 index 00000000..d4980238 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/XCommandNoforceClick.cs @@ -0,0 +1,171 @@ +using System; +using UILib; +using UnityEngine; +using XMainClient.UI; +using XMainClient.UI.UICommon; +using XUpdater; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XCommandNoforceClick : XBaseCommand + { + private GameObject _finger; + + private int orgWidth1; + + private int orgHeight1; + + private int orgWidth2; + + private int orgHeight2; + + public override bool Execute() + { + bool flag = this._cmd.param2 == "_canvas/SkillFrame/Skill0"; + if (flag) + { + bool flag2 = DlgBase.singleton.IsLoaded(); + if (flag2) + { + DlgBase.singleton.SkillHandler.AlwaysHot(0, true); + } + XSingleton.singleton.Player.Skill.EndSkill(true, false); + } + Transform transform = XSingleton.singleton.UIRoot.Find(this._cmd.param1 + "(Clone)"); + bool flag3 = !transform || !transform.gameObject.activeInHierarchy; + bool result; + if (flag3) + { + result = false; + } + else + { + Transform transform2 = XSingleton.singleton.FindChild(transform, this._cmd.param2); + bool flag4 = transform2 == null || !transform2.gameObject.activeInHierarchy; + if (flag4) + { + bool flag5 = transform2 == null && this._cmd.isOutError; + if (flag5) + { + this._cmd.isOutError = false; + XSingleton.singleton.AddErrorLog(string.Concat(new object[] + { + "TutorialId:", + this._cmd.TutorialID, + " Configuration File Path Error! tag:", + this._cmd.tag, + "\nPath:", + this._cmd.param1, + "(Clone)/", + this._cmd.param2 + }), null, null, null, null, null); + } + result = false; + } + else + { + this._startTime = Time.time; + bool flag6 = this._finger == null; + if (flag6) + { + this._finger = (XSingleton.singleton.CreateFromPrefab("UI/Common/Quan", true, false) as GameObject); + } + bool flag7 = this._cmd.param3 != null; + if (flag7) + { + float num = float.Parse(this._cmd.param3); + bool flag8 = num >= 0f; + if (flag8) + { + IXUISprite ixuisprite = this._finger.transform.Find("Quan1").GetComponent("XUISprite") as IXUISprite; + this.orgWidth1 = ixuisprite.spriteWidth; + this.orgHeight1 = ixuisprite.spriteHeight; + ixuisprite.spriteWidth = (int)((float)ixuisprite.spriteWidth * num); + ixuisprite.spriteHeight = (int)((float)ixuisprite.spriteHeight * num); + } + } + bool flag9 = this._cmd.param4 != null; + if (flag9) + { + float num2 = float.Parse(this._cmd.param4); + bool flag10 = num2 >= 0f; + if (flag10) + { + IXUISprite ixuisprite2 = this._finger.transform.Find("Quan2").GetComponent("XUISprite") as IXUISprite; + this.orgWidth2 = ixuisprite2.spriteWidth; + this.orgHeight2 = ixuisprite2.spriteHeight; + ixuisprite2.spriteWidth = (int)((float)ixuisprite2.spriteWidth * num2); + ixuisprite2.spriteHeight = (int)((float)ixuisprite2.spriteHeight * num2); + } + } + IXUIObject ixuiobject = transform2.GetComponent("XUIObject") as IXUIObject; + ixuiobject.Exculsive = true; + XSingleton.singleton.AddChild(transform2, this._finger.transform); + bool flag11 = this._cmd.param5 == null; + if (flag11) + { + this._cmd.param5 = "0"; + } + bool flag12 = this._cmd.param6 == null; + if (flag12) + { + this._cmd.param6 = "0"; + } + this._finger.transform.localPosition += new Vector3(float.Parse(this._cmd.param5), float.Parse(this._cmd.param6), 0f); + this._finger.SetActive(false); + this._finger.SetActive(true); + base.SetTutorialText(this._cmd.textPos, transform2); + base.SetButtomText(); + base.SetAilin(); + bool pause = this._cmd.pause; + if (pause) + { + XSingleton.singleton.Pause = true; + } + XSingleton.singleton.NoforceClick = true; + base.publicModule(); + result = true; + } + } + return result; + } + + public override void OnFinish() + { + this.Stop(); + } + + public override void Stop() + { + bool flag = this._finger != null; + if (flag) + { + bool flag2 = this._cmd.param3 != null; + if (flag2) + { + IXUISprite ixuisprite = this._finger.transform.Find("Quan1").GetComponent("XUISprite") as IXUISprite; + ixuisprite.spriteWidth = this.orgWidth1; + ixuisprite.spriteHeight = this.orgHeight1; + } + bool flag3 = this._cmd.param4 != null; + if (flag3) + { + IXUISprite ixuisprite2 = this._finger.transform.Find("Quan2").GetComponent("XUISprite") as IXUISprite; + ixuisprite2.spriteWidth = this.orgWidth2; + ixuisprite2.spriteHeight = this.orgHeight2; + } + XResourceLoaderMgr.SafeDestroy(ref this._finger, false); + } + base.DestroyAilin(); + XSingleton.singleton.Pause = false; + XSingleton.singleton.NoforceClick = false; + bool flag4 = DlgBase.singleton.IsLoaded() && DlgBase.singleton.SkillHandler != null; + if (flag4) + { + DlgBase.singleton.SkillHandler.AlwaysHot(0, false); + } + base.Stop(); + } + } +} -- cgit v1.1-26-g67d0