summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandEmpty.cs
blob: d33f158573b0f6bad11503123180361869c764b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
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;
		}
	}
}