diff options
author | chai <chaifix@163.com> | 2021-01-25 14:28:30 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-01-25 14:28:30 +0800 |
commit | 6eb915c129fc90c6f4c82ae097dd6ffad5239efc (patch) | |
tree | 7dd2be50edf41f36b60fac84696e731c13afe617 /Client/Assets/Scripts/XMainClient/Tutorial/Command |
+scripts
Diffstat (limited to 'Client/Assets/Scripts/XMainClient/Tutorial/Command')
10 files changed, 410 insertions, 0 deletions
diff --git a/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandEmpty.cs b/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandEmpty.cs new file mode 100644 index 00000000..d33f1585 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandEmpty.cs @@ -0,0 +1,68 @@ +using System;
+using UILib;
+using UnityEngine;
+using XUpdater;
+using XUtliPoolLib;
+
+namespace XMainClient.Tutorial.Command
+{
+ internal class XCommandEmpty : XBaseCommand
+ {
+ private uint _time = 0u;
+
+ public override bool Execute()
+ {
+ this._startTime = Time.time;
+ bool flag = this._cmd.interalDelay > 0f;
+ if (flag)
+ {
+ base.SetOverlay();
+ }
+ this._time = XSingleton<XTimerMgr>.singleton.SetTimer(this._cmd.interalDelay, new XTimerMgr.ElapsedEventHandler(this.ShowFinger), null);
+ base.publicModule();
+ return true;
+ }
+
+ protected void ShowFinger(object o)
+ {
+ base.SetOverlay();
+ base.SetAilin();
+ bool flag = string.IsNullOrEmpty(this._cmd.ailinText) && XBaseCommand._Overlay != null;
+ if (flag)
+ {
+ IXUISprite ixuisprite = XBaseCommand._Overlay.transform.Find("Left").GetComponent("XUISprite") as IXUISprite;
+ ixuisprite.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnMouseClick));
+ }
+ bool pause = this._cmd.pause;
+ if (pause)
+ {
+ XSingleton<XShell>.singleton.Pause = true;
+ }
+ }
+
+ protected override void OnMouseClick(IXUISprite sp)
+ {
+ base.OnMouseClick(sp);
+ bool flag = string.IsNullOrEmpty(this._cmd.ailinText);
+ if (flag)
+ {
+ XSingleton<XTutorialMgr>.singleton.OnCmdFinished();
+ }
+ }
+
+ public override void Stop()
+ {
+ bool flag = this._time > 0u;
+ if (flag)
+ {
+ XSingleton<XTimerMgr>.singleton.KillTimer(this._time);
+ this._time = 0u;
+ }
+ base.DestroyText();
+ base.DestroyAilin();
+ base.DestroyOverlay();
+ XSingleton<XShell>.singleton.Pause = false;
+ XSingleton<XTutorialMgr>.singleton.NoforceClick = false;
+ }
+ }
+}
diff --git a/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandEmpty.cs.meta b/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandEmpty.cs.meta new file mode 100644 index 00000000..5935b926 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandEmpty.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 093c136e3192d6c4490514b9e2233552 +timeCreated: 1611403152 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandHideSkills.cs b/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandHideSkills.cs new file mode 100644 index 00000000..7e1ce75a --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandHideSkills.cs @@ -0,0 +1,39 @@ +using System;
+using XMainClient.UI;
+using XMainClient.UI.UICommon;
+
+namespace XMainClient.Tutorial.Command
+{
+ internal class XCommandHideSkills : XBaseCommand
+ {
+ public override bool Execute()
+ {
+ bool flag = !string.IsNullOrEmpty(this._cmd.param1);
+ if (flag)
+ {
+ this.Hide(int.Parse(this._cmd.param1));
+ }
+ bool flag2 = !string.IsNullOrEmpty(this._cmd.param2);
+ if (flag2)
+ {
+ this.Hide(int.Parse(this._cmd.param2));
+ }
+ bool flag3 = !string.IsNullOrEmpty(this._cmd.param3);
+ if (flag3)
+ {
+ this.Hide(int.Parse(this._cmd.param3));
+ }
+ base.publicModule();
+ return true;
+ }
+
+ private void Hide(int idx)
+ {
+ bool flag = DlgBase<BattleMain, BattleMainBehaviour>.singleton.IsLoaded();
+ if (flag)
+ {
+ DlgBase<BattleMain, BattleMainBehaviour>.singleton.SkillHandler.DisableSkill(idx);
+ }
+ }
+ }
+}
diff --git a/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandHideSkills.cs.meta b/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandHideSkills.cs.meta new file mode 100644 index 00000000..63b106db --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandHideSkills.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: e038412c115d2ac4d8e9ec75c25092b7 +timeCreated: 1611404696 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandIsShowButton.cs b/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandIsShowButton.cs new file mode 100644 index 00000000..7d5bbf98 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandIsShowButton.cs @@ -0,0 +1,37 @@ +using System;
+using XMainClient.UI.UICommon;
+
+namespace XMainClient.Tutorial.Command
+{
+ internal class XCommandIsShowButton : XBaseCommand
+ {
+ public override bool Execute()
+ {
+ bool flag = this._cmd.param1 == null || this._cmd.param2 == null;
+ bool result;
+ if (flag)
+ {
+ result = false;
+ }
+ else
+ {
+ int num = int.Parse(this._cmd.param2);
+ bool flag2 = num == 0;
+ bool learnSkillButtonState = !flag2;
+ bool flag3 = this._cmd.param1 == "LearnSkillButton";
+ if (flag3)
+ {
+ this.SetLearnSkillButtonState(learnSkillButtonState);
+ }
+ base.publicModule();
+ result = true;
+ }
+ return result;
+ }
+
+ private void SetLearnSkillButtonState(bool state)
+ {
+ DlgBase<XSkillTreeView, XSkillTreeBehaviour>.singleton.SetLearnSkillButtonState(state);
+ }
+ }
+}
diff --git a/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandIsShowButton.cs.meta b/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandIsShowButton.cs.meta new file mode 100644 index 00000000..d666a895 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandIsShowButton.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 8ec22b9731eefe142900fac92e5881bc +timeCreated: 1611404131 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandNote.cs b/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandNote.cs new file mode 100644 index 00000000..cc9a2c95 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandNote.cs @@ -0,0 +1,167 @@ +using System;
+using UILib;
+using UnityEngine;
+using XMainClient.UI;
+using XUpdater;
+using XUtliPoolLib;
+
+namespace XMainClient.Tutorial.Command
+{
+ internal class XCommandNote : XBaseCommand
+ {
+ private GameObject _finger;
+
+ private int orgWidth;
+
+ private int orgHeight;
+
+ private GameObject _cloneGo;
+
+ private GameObject _clickGo;
+
+ private uint _time = 0u;
+
+ public override bool Execute()
+ {
+ Transform transform = XSingleton<XGameUI>.singleton.UIRoot.Find(this._cmd.param1 + "(Clone)");
+ bool flag = !transform || !transform.gameObject.activeInHierarchy;
+ bool result;
+ if (flag)
+ {
+ result = false;
+ }
+ else
+ {
+ Transform transform2 = XSingleton<UiUtility>.singleton.FindChild(transform, this._cmd.param2);
+ bool flag2 = transform2 == null || !transform2.gameObject.activeInHierarchy;
+ if (flag2)
+ {
+ bool flag3 = transform2 == null && this._cmd.isOutError;
+ if (flag3)
+ {
+ this._cmd.isOutError = false;
+ XSingleton<XDebug>.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;
+ this._clickGo = transform2.gameObject;
+ bool flag4 = this._cmd.interalDelay > 0f;
+ if (flag4)
+ {
+ base.SetOverlay();
+ }
+ this._time = XSingleton<XTimerMgr>.singleton.SetTimer(this._cmd.interalDelay, new XTimerMgr.ElapsedEventHandler(this.ShowFinger), null);
+ base.publicModule();
+ result = true;
+ }
+ }
+ return result;
+ }
+
+ protected void ShowFinger(object o)
+ {
+ bool flag = this._finger == null;
+ if (flag)
+ {
+ this._finger = (XSingleton<XResourceLoaderMgr>.singleton.CreateFromPrefab("UI/Common/TutorialK", true, false) as GameObject);
+ }
+ this._finger.SetActive(false);
+ string param = this._cmd.param3;
+ string[] array = param.Split(XGlobalConfig.AllSeparators);
+ float num = float.Parse(array[0]);
+ float num2 = (array.Length > 1) ? float.Parse(array[1]) : num;
+ float num3 = (array.Length > 2) ? float.Parse(array[2]) : 0f;
+ float num4 = (array.Length > 3) ? float.Parse(array[3]) : 0f;
+ bool flag2 = num > 0f;
+ if (flag2)
+ {
+ IXUISprite ixuisprite = this._finger.transform.Find("Quan").GetComponent("XUISprite") as IXUISprite;
+ this.orgWidth = ixuisprite.spriteWidth;
+ this.orgHeight = ixuisprite.spriteHeight;
+ ixuisprite.spriteWidth = (int)((float)ixuisprite.spriteWidth * num);
+ ixuisprite.spriteHeight = (int)((float)ixuisprite.spriteHeight * num2);
+ ixuisprite.gameObject.transform.localPosition = new Vector3(num3, num4, 0f);
+ }
+ base.SetOverlay();
+ this._cloneGo = XCommon.Instantiate<GameObject>(this._clickGo);
+ this.SetupCloneButton(this._clickGo, this._cloneGo);
+ base.SetTutorialText(this._cmd.textPos, this._cloneGo.transform);
+ this._finger.SetActive(false);
+ this._finger.SetActive(true);
+ base.SetAilin();
+ bool pause = this._cmd.pause;
+ if (pause)
+ {
+ XSingleton<XShell>.singleton.Pause = true;
+ }
+ }
+
+ public override void Update()
+ {
+ base.Update();
+ bool flag = this._cloneGo != null && this._clickGo != null;
+ if (flag)
+ {
+ Vector3 position = this._clickGo.transform.position;
+ Vector3 localPosition = XBaseCommand._Overlay.transform.InverseTransformPoint(position);
+ localPosition.z = 0f;
+ this._cloneGo.transform.localPosition = localPosition;
+ }
+ }
+
+ protected void SetupCloneButton(GameObject targetGo, GameObject cloneGo)
+ {
+ XSingleton<UiUtility>.singleton.AddChild(cloneGo.transform, this._finger.transform);
+ cloneGo.name = targetGo.name;
+ cloneGo.transform.parent = XBaseCommand._Overlay.transform;
+ Vector3 position = targetGo.transform.position;
+ Vector3 localPosition = XBaseCommand._Overlay.transform.InverseTransformPoint(position);
+ localPosition.z = 0f;
+ cloneGo.transform.localPosition = localPosition;
+ cloneGo.transform.localScale = targetGo.transform.localScale;
+ }
+
+ public override void Stop()
+ {
+ bool flag = this._time > 0u;
+ if (flag)
+ {
+ XSingleton<XTimerMgr>.singleton.KillTimer(this._time);
+ this._time = 0u;
+ }
+ bool flag2 = this._finger != null;
+ if (flag2)
+ {
+ IXUISprite ixuisprite = this._finger.transform.Find("Quan").GetComponent("XUISprite") as IXUISprite;
+ ixuisprite.spriteWidth = this.orgWidth;
+ ixuisprite.spriteHeight = this.orgHeight;
+ XResourceLoaderMgr.SafeDestroy(ref this._finger, false);
+ }
+ base.DestroyText();
+ bool flag3 = this._cloneGo != null;
+ if (flag3)
+ {
+ this._cloneGo.transform.parent = null;
+ UnityEngine.Object.Destroy(this._cloneGo);
+ this._cloneGo = null;
+ }
+ base.DestroyAilin();
+ base.DestroyOverlay();
+ XSingleton<XShell>.singleton.Pause = false;
+ XSingleton<XTutorialMgr>.singleton.NoforceClick = false;
+ }
+ }
+}
diff --git a/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandNote.cs.meta b/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandNote.cs.meta new file mode 100644 index 00000000..35d519c1 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandNote.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: e6548cb3d77bf324697c4717bb9c063f +timeCreated: 1611404746 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandShowSkills.cs b/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandShowSkills.cs new file mode 100644 index 00000000..eb4a36e7 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandShowSkills.cs @@ -0,0 +1,39 @@ +using System;
+using XMainClient.UI;
+using XMainClient.UI.UICommon;
+
+namespace XMainClient.Tutorial.Command
+{
+ internal class XCommandShowSkills : XBaseCommand
+ {
+ public override bool Execute()
+ {
+ bool flag = !string.IsNullOrEmpty(this._cmd.param1);
+ if (flag)
+ {
+ this.Show(int.Parse(this._cmd.param1));
+ }
+ bool flag2 = !string.IsNullOrEmpty(this._cmd.param2);
+ if (flag2)
+ {
+ this.Show(int.Parse(this._cmd.param2));
+ }
+ bool flag3 = !string.IsNullOrEmpty(this._cmd.param3);
+ if (flag3)
+ {
+ this.Show(int.Parse(this._cmd.param3));
+ }
+ base.publicModule();
+ return true;
+ }
+
+ private void Show(int idx)
+ {
+ bool flag = DlgBase<BattleMain, BattleMainBehaviour>.singleton.IsLoaded();
+ if (flag)
+ {
+ DlgBase<BattleMain, BattleMainBehaviour>.singleton.SkillHandler.EnableSkill(idx);
+ }
+ }
+ }
+}
diff --git a/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandShowSkills.cs.meta b/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandShowSkills.cs.meta new file mode 100644 index 00000000..d2b63682 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandShowSkills.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: e2cdcb4267af24843b241db51ef82ece +timeCreated: 1611404729 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: |