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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
|
using System;
using UILib;
using UnityEngine;
using XMainClient.UI;
using XMainClient.UI.UICommon;
using XUpdater;
using XUtliPoolLib;
namespace XMainClient
{
internal class XCommandPrefab : XBaseCommand
{
private GameObject _Prefab;
private uint _time = 0u;
private uint _time2 = 0u;
public override bool Execute()
{
bool flag = this._cmd.param2 == "SelectSight";
bool result;
if (flag)
{
bool pause = this._cmd.pause;
if (pause)
{
XSingleton<XShell>.singleton.Pause = true;
}
DlgBase<CutoverViewView, CutoverViewBehaviour>.singleton.SetVisibleWithAnimation(true, null);
result = true;
}
else
{
bool flag2 = this._cmd.param2 == "SelectSkipTutorial";
if (flag2)
{
DlgBase<TutorialSkipView, TutorialSkipBehaviour>.singleton.SetVisibleWithAnimation(true, null);
result = true;
}
else
{
this._time = XSingleton<XTimerMgr>.singleton.SetTimer(this._cmd.interalDelay, new XTimerMgr.ElapsedEventHandler(this.ShowVT), null);
base.publicModule();
result = true;
}
}
return result;
}
protected void ShowVT(object o)
{
base.SetOverlay();
this.ShowPic();
bool pause = this._cmd.pause;
if (pause)
{
XSingleton<XShell>.singleton.Pause = true;
}
}
protected void ShowPic()
{
bool flag = this._Prefab == null;
if (flag)
{
this._Prefab = (XSingleton<XResourceLoaderMgr>.singleton.CreateFromPrefab(this._cmd.param1, true, false) as GameObject);
}
XSingleton<UiUtility>.singleton.AddChild(XBaseCommand._Overlay, this._Prefab);
IXUITweenTool ixuitweenTool = this._Prefab.GetComponent("XUIPlayTween") as IXUITweenTool;
bool flag2 = this._cmd.param2 == "Time";
if (flag2)
{
this._time2 = XSingleton<XTimerMgr>.singleton.SetTimer(float.Parse(this._cmd.param3), new XTimerMgr.ElapsedEventHandler(this.TweenFinish), null);
}
else
{
bool flag3 = this._cmd.param2 == "PlayFinished";
if (flag3)
{
ixuitweenTool.RegisterOnFinishEventHandler(new OnTweenFinishEventHandler(this.OnTweenFinish));
}
else
{
XSingleton<XDebug>.singleton.AddErrorLog("Tutorial ShowPrefab No Finish Way!\nTag:" + this._cmd.tag, null, null, null, null, null);
}
}
ixuitweenTool.PlayTween(true, -1f);
}
protected void TweenFinish(object o)
{
this.RegisterOnMouseClick();
}
protected void OnTweenFinish(IXUITweenTool tool)
{
this.RegisterOnMouseClick();
}
protected void RegisterOnMouseClick()
{
bool flag = this._Prefab != null;
if (flag)
{
IXUISprite ixuisprite = this._Prefab.transform.Find("Bg").GetComponent("XUISprite") as IXUISprite;
ixuisprite.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnMouseClick));
}
else
{
this.OnMouseClick(null);
}
}
protected override void OnMouseClick(IXUISprite sp)
{
base.OnMouseClick(sp);
XSingleton<XTutorialMgr>.singleton.OnCmdFinished();
}
public override void Stop()
{
bool flag = this._time > 0u;
if (flag)
{
XSingleton<XTimerMgr>.singleton.KillTimer(this._time);
this._time = 0u;
}
bool flag2 = this._time2 > 0u;
if (flag2)
{
XSingleton<XTimerMgr>.singleton.KillTimer(this._time2);
this._time2 = 0u;
}
XResourceLoaderMgr.SafeDestroy(ref this._Prefab, false);
base.DestroyAilin();
base.DestroyOverlay();
XSingleton<XShell>.singleton.Pause = false;
XSingleton<XTutorialMgr>.singleton.Exculsive = false;
}
}
}
|