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
143
144
145
|
using System;
using System.Collections.Generic;
using KKSG;
using UnityEngine;
using XMainClient.UI;
using XMainClient.UI.UICommon;
using XUtliPoolLib;
namespace XMainClient
{
internal class heromvp
{
private static uint _token = 0u;
private static XActor _actor = null;
private static bool _started = false;
private static Vector3 _pos = Vector3.zero;
public static bool Do(List<XActor> actors)
{
bool flag = !heromvp._started;
if (flag)
{
heromvp._started = true;
heromvp.Start();
}
else
{
bool flag2 = !XSingleton<XCutScene>.singleton.IsPlaying;
if (flag2)
{
heromvp._started = false;
heromvp.End();
}
}
return true;
}
private static void Start()
{
DlgBase<HeroBattleMVPDlg, HeroBattleMVPBehaviour>.singleton.SetVisible(true, true);
XHeroBattleDocument specificDocument = XDocuments.GetSpecificDocument<XHeroBattleDocument>(XHeroBattleDocument.uuID);
HeroBattleMapCenter.RowData bySceneID = specificDocument.HeroBattleMapReader.GetBySceneID(XSingleton<XScene>.singleton.SceneID);
Vector3 one = Vector3.one;
float angle = 0f;
bool flag = bySceneID != null && bySceneID.MVPPos.Length >= 4;
if (flag)
{
one = new Vector3(bySceneID.MVPPos[0], bySceneID.MVPPos[1], bySceneID.MVPPos[2]);
angle = bySceneID.MVPPos[3];
}
heromvp._pos = one;
heromvp._pos.y = XSingleton<XScene>.singleton.TerrainY(heromvp._pos);
XLevelRewardDocument specificDocument2 = XDocuments.GetSpecificDocument<XLevelRewardDocument>(XLevelRewardDocument.uuID);
XLevelRewardDocument.HeroBattleData heroBattleData = (XSingleton<XScene>.singleton.SceneType == SceneType.SCENE_HEROBATTLE) ? specificDocument2.HeroData : specificDocument2.MobaData;
OverWatchTable.RowData byHeroID = specificDocument.OverWatchReader.GetByHeroID(heroBattleData.MvpHeroID);
bool flag2 = byHeroID == null;
if (flag2)
{
XSingleton<XDebug>.singleton.AddErrorLog("MvpHeroID error! ID = ", heroBattleData.MvpHeroID.ToString(), null, null, null, null);
}
else
{
uint presentID = XSingleton<XEntityMgr>.singleton.EntityStatistics.GetByID(byHeroID.StatisticsID[0]).PresentID;
XEntityPresentation.RowData byPresentID = XSingleton<XEntityMgr>.singleton.EntityInfo.GetByPresentID(presentID);
bool flag3 = byPresentID == null;
if (flag3)
{
XSingleton<XDebug>.singleton.AddErrorLog("MvpHeroID error! ID = ", presentID.ToString(), null, null, null, null);
}
else
{
string str = "Animation/" + byPresentID.AnimLocation;
heromvp._actor = new XActor("Prefabs/" + byPresentID.Prefab, heromvp._pos, XSingleton<XCommon>.singleton.FloatToQuaternion(angle), str + byHeroID.CutSceneAniamtion);
heromvp._actor.Initilize(0);
heromvp._actor.GetCurrentAnimLength(new OverrideAnimCallback(heromvp.AnimLoadCallback));
}
}
}
private static void AnimLoadCallback(XAnimationClip clip)
{
float num = (clip != null) ? clip.length : 0f;
bool flag = num > 0f;
if (flag)
{
heromvp._token = XSingleton<XTimerMgr>.singleton.SetTimer(num, new XTimerMgr.ElapsedEventHandler(heromvp.Idled), null);
}
else
{
heromvp.Idled(null);
}
}
private static void Idled(object o)
{
bool flag = heromvp._actor != null;
if (flag)
{
XHeroBattleDocument specificDocument = XDocuments.GetSpecificDocument<XHeroBattleDocument>(XHeroBattleDocument.uuID);
XLevelRewardDocument specificDocument2 = XDocuments.GetSpecificDocument<XLevelRewardDocument>(XLevelRewardDocument.uuID);
XLevelRewardDocument.HeroBattleData heroBattleData = (XSingleton<XScene>.singleton.SceneType == SceneType.SCENE_HEROBATTLE) ? specificDocument2.HeroData : specificDocument2.MobaData;
OverWatchTable.RowData byHeroID = specificDocument.OverWatchReader.GetByHeroID(heroBattleData.MvpHeroID);
bool flag2 = byHeroID == null;
if (flag2)
{
XSingleton<XDebug>.singleton.AddErrorLog("MvpHeroID error! ID = ", heroBattleData.MvpHeroID.ToString(), null, null, null, null);
}
else
{
uint presentID = XSingleton<XEntityMgr>.singleton.EntityStatistics.GetByID(byHeroID.StatisticsID[0]).PresentID;
XEntityPresentation.RowData byPresentID = XSingleton<XEntityMgr>.singleton.EntityInfo.GetByPresentID(presentID);
bool flag3 = byPresentID == null;
if (flag3)
{
XSingleton<XDebug>.singleton.AddErrorLog("MvpHeroID error! ID = ", presentID.ToString(), null, null, null, null);
}
else
{
bool flag4 = string.IsNullOrEmpty(byHeroID.CutSceneIdleAni);
if (!flag4)
{
string str = "Animation/" + byPresentID.AnimLocation;
heromvp._actor.OverrideAnim(str + byHeroID.CutSceneIdleAni);
}
}
}
}
}
private static void End()
{
XSingleton<XTimerMgr>.singleton.KillTimer(heromvp._token);
DlgBase<HeroBattleMVPDlg, HeroBattleMVPBehaviour>.singleton.SetVisible(false, true);
bool flag = heromvp._actor != null;
if (flag)
{
heromvp._actor.Uninitilize();
heromvp._actor = null;
}
}
}
}
|