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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
|
using System;
using System.Collections;
using System.Collections.Generic;
using KKSG;
using UnityEngine;
using UnityEngine.SceneManagement;
using XMainClient.UI;
using XMainClient.UI.UICommon;
using XUpdater;
using XUtliPoolLib;
namespace XMainClient
{
public sealed class XSceneLoader : MonoBehaviour
{
private AsyncOperation _op = null;
private XSceneLoader.AsyncSceneBuildRequest _asbr = null;
private uint _loading_scene_id = 0u;
private EXStage _loading_scene_stage = EXStage.Null;
private bool _enabled = false;
private bool _prograss = true;
private float _sub_progress = 0f;
private float _current_progress = 0f;
private float _target_progress = 0f;
private bool _DelayLoadCache = true;
private bool _LoadingSpectateScene = false;
private enum LoadingPhase
{
Scene_Downlaod,
Scene_Load,
Scene_Build,
Scene_Doc
}
private class AsyncSceneBuildRequest
{
public float Progress = 1f;
public IEnumerator Pedometer = null;
}
public void LoadScene(string scene, EXStage eStage, bool prograss, uint nextsceneid, uint currentsceneid)
{
XSingleton<XGame>.singleton.notLoadScene = false;
XSingleton<XGame>.singleton.networkRun = false;
XSingleton<XTimerMgr>.singleton.update = false;
this._loading_scene_id = nextsceneid;
this._loading_scene_stage = eStage;
this._prograss = prograss;
XSingleton<XClientNetwork>.singleton.Clear();
ObjectPoolCache.Clear();
XSingleton<XUpdater.XUpdater>.singleton.XPlatform.ClearClass();
bool settingEnum = XSingleton<XGlobalConfig>.singleton.GetSettingEnum(ESettingConfig.EClearBundle);
if (settingEnum)
{
XSingleton<XUpdater.XUpdater>.singleton.Clear();
}
XSingleton<XDebug>.singleton.BeginRecord();
XSingleton<XUpdater.XUpdater>.singleton.XPlatform.MarkLevelEnd();
XSingleton<XUpdater.XUpdater>.singleton.XPlatform.MarkLoadlevel(scene);
XQualitySetting.SwitchScene();
XSingleton<XGameUI>.singleton.m_uiTool.PreLoad(false);
XSingleton<XGameUI>.singleton.m_uiTool.ReleaseAllDrawCall();
XSingleton<XResourceLoaderMgr>.singleton.CallUnloadCallback();
XSingleton<XResourceLoaderMgr>.singleton.ReleasePool();
this._DelayLoadCache = XSingleton<XResourceLoaderMgr>.singleton.DelayLoad;
XSingleton<XResourceLoaderMgr>.singleton.DelayLoad = false;
XSpectateDocument specificDocument = XDocuments.GetSpecificDocument<XSpectateDocument>(XSpectateDocument.uuID);
this._LoadingSpectateScene = specificDocument.IsLoadingSpectateScene;
bool flag = SceneType.SCENE_PK != XSingleton<XSceneMgr>.singleton.GetSceneType(nextsceneid) && SceneType.SCENE_INVFIGHT != XSingleton<XSceneMgr>.singleton.GetSceneType(nextsceneid) && SceneType.SCENE_LEAGUE_BATTLE != XSingleton<XSceneMgr>.singleton.GetSceneType(nextsceneid);
if (flag)
{
DlgBase<LoadingDlg, LoadingDlgBehaviour>.singleton.Load();
bool isLoadingSpectateScene = specificDocument.IsLoadingSpectateScene;
if (isLoadingSpectateScene)
{
specificDocument.IsLoadingSpectateScene = false;
string[] array = XSingleton<XGlobalConfig>.singleton.GetValue("Spectate_Tips").Split(XGlobalConfig.ListSeparator);
int num = UnityEngine.Random.Range(0, array.Length);
DlgBase<LoadingDlg, LoadingDlgBehaviour>.singleton.SetLoadingTip(array[num]);
}
else
{
string loadingTip = (currentsceneid == 1u) ? XSingleton<XSceneMgr>.singleton.GetSceneLoadingTips(true, nextsceneid) : ((nextsceneid == 1u) ? XSingleton<XSceneMgr>.singleton.GetSceneLoadingTips(false, currentsceneid) : ((nextsceneid == 100u) ? XSingleton<XSceneMgr>.singleton.GetSceneLoadingTips(true, nextsceneid) : ((nextsceneid == 3u) ? XSingleton<XSceneMgr>.singleton.GetSceneLoadingTips(false, 2u) : XSingleton<XSceneMgr>.singleton.GetSceneLoadingTips(true, nextsceneid))));
DlgBase<LoadingDlg, LoadingDlgBehaviour>.singleton.SetLoadingTip(loadingTip);
}
bool flag2 = nextsceneid == 100u || nextsceneid == 21u || nextsceneid == 22u;
string text;
if (flag2)
{
text = this.GetMyProfessionLoadingPic();
}
else
{
text = XSingleton<XSceneMgr>.singleton.GetSceneLoadingPic(nextsceneid);
}
bool flag3 = string.IsNullOrEmpty(text);
if (flag3)
{
prograss = false;
}
else
{
DlgBase<LoadingDlg, LoadingDlgBehaviour>.singleton.SetLoadingPic(text);
}
DlgBase<LoadingDlg, LoadingDlgBehaviour>.singleton.SetVisible(prograss, true);
DlgBase<LoadingDlg, LoadingDlgBehaviour>.singleton.SetLoadingProgress(0f);
}
Application.backgroundLoadingPriority = (ThreadPriority)4;
base.StartCoroutine(this.LoadLevelWithProgress(scene));
XSingleton<XScene>.singleton.OnSceneBeginLoad(this._loading_scene_id);
}
private IEnumerator LoadLevelWithProgress(string scene)
{
base.enabled = true;
this._enabled = true;
this._current_progress = 0f;
this._target_progress = 0f;
this.DisplayPrograss(XSceneLoader.LoadingPhase.Scene_Downlaod, 1f);
yield return null;
bool flag = SceneType.SCENE_PK == XSingleton<XScene>.singleton.SceneType || SceneType.SCENE_INVFIGHT == XSingleton<XScene>.singleton.SceneType;
if (flag)
{
DlgBase<XPkLoadingView, XPkLoadingBehaviour>.singleton.ShowPkLoading(XSingleton<XScene>.singleton.SceneType);
}
else
{
bool flag2 = SceneType.SCENE_LEAGUE_BATTLE == XSingleton<XScene>.singleton.SceneType;
if (flag2)
{
DlgBase<XTeamLeagueLoadingView, XTeamLeagueLoadingBehaviour>.singleton.ShowPkLoading();
}
else
{
bool flag3 = SceneType.SCENE_PKTWO == XSingleton<XScene>.singleton.SceneType;
if (flag3)
{
DlgBase<XMultiPkLoadingView, XMultiPkLoadingBehaviour>.singleton.ShowPkLoading();
}
}
}
XSingleton<XGameUI>.singleton.m_uiTool.EnableUILoadingUpdate(true);
yield return null;
this.DisplayPrograss(XSceneLoader.LoadingPhase.Scene_Load, 0f);
bool flag4 = XSingleton<XUpdater.XUpdater>.singleton.ABManager != null;
if (flag4)
{
XSingleton<XUpdater.XUpdater>.singleton.ABManager.UnloadUnusedBundle(true);
}
this._op = SceneManager.LoadSceneAsync("empty");
while (!this._op.isDone)
{
yield return null;
}
this._op = Resources.UnloadUnusedAssets();
while (!this._op.isDone)
{
yield return null;
}
XSingleton<XResourceLoaderMgr>.singleton.LoadABScene(XSingleton<XSceneMgr>.singleton.GetScenePath(this._loading_scene_id));
this._op = SceneManager.LoadSceneAsync(scene);
while (!this._op.isDone)
{
yield return null;
}
XSingleton<XResourceLoaderMgr>.singleton.DelayLoad = this._DelayLoadCache;
XQualitySetting.PostSceneLoad();
this.DisplayPrograss(XSceneLoader.LoadingPhase.Scene_Load, 1f);
XSingleton<XDebug>.singleton.AddLog("-------------scene ready & begin load other res-------------", null, null, null, null, null, XDebugColor.XDebug_None);
yield return null;
this._asbr = this.SceneBuildAsync(this._loading_scene_id);
yield return null;
while (this._asbr.Pedometer.MoveNext())
{
this.DisplayPrograss(XSceneLoader.LoadingPhase.Scene_Build, this._asbr.Progress);
yield return null;
}
this._asbr = null;
bool prograss = this._prograss;
if (prograss)
{
bool flag5 = XStage.IsConcreteStage(this._loading_scene_stage);
if (flag5)
{
XSingleton<XScene>.singleton.RefreshScenMustTransform();
this.CreatePlayer();
this.DisplayPrograss(XSceneLoader.LoadingPhase.Scene_Doc, 0.3f);
yield return null;
IEnumerator iter = this.DocPreload(this._loading_scene_id);
while (iter.MoveNext())
{
this.DisplayPrograss(XSceneLoader.LoadingPhase.Scene_Doc, 0.3f + 0.4f * this._sub_progress);
yield return null;
}
iter = null;
}
XSingleton<XGame>.singleton.OnEnterScene(this._loading_scene_id, false);
this.DisplayPrograss(XSceneLoader.LoadingPhase.Scene_Doc, 0.9f);
bool flag6 = this._loading_scene_id == 100u;
if (flag6)
{
uint idx = XSingleton<XEntityMgr>.singleton.Player.BasicTypeID - 1u;
uint id = XSingleton<XGlobalConfig>.singleton.NewbieLevelRoleID[(int)idx];
XEntityStatistics.RowData raw = XSingleton<XEntityMgr>.singleton.EntityStatistics.GetByID(id);
XSingleton<XEntityMgr>.singleton.Player.OnTransform(raw.ID);
yield return null;
raw = null;
}
this.DisplayPrograss(XSceneLoader.LoadingPhase.Scene_Doc, 1f);
yield return null;
this._target_progress = 0.9f;
bool flag7 = this._prograss && this._current_progress < 0.89f;
if (flag7)
{
yield return null;
}
this._enabled = false;
DlgBase<LoadingDlg, LoadingDlgBehaviour>.singleton.SetLoadingProgress(1f);
yield return null;
bool flag8 = XStage.IsConcreteStage(this._loading_scene_stage);
if (flag8)
{
RpcC2G_DoEnterScene DoEnterSceneRpc = new RpcC2G_DoEnterScene();
DoEnterSceneRpc.oArg.sceneid = XSingleton<XScene>.singleton.SceneID;
XSingleton<XClientNetwork>.singleton.Send(DoEnterSceneRpc);
XSingleton<XScene>.singleton.bSceneLoadedRpcSend = true;
DoEnterSceneRpc = null;
}
}
else
{
XSingleton<XGame>.singleton.OnEnterScene(this._loading_scene_id, false);
}
bool flag9 = XStage.IsConcreteStage(this._loading_scene_stage);
if (flag9)
{
yield return null;
}
else
{
XSingleton<XScene>.singleton.bSceneServerReady = (XSingleton<XScene>.singleton.Error == ErrorCode.ERR_SUCCESS);
yield return null;
}
int waitTime = 1;
XSingleton<XGame>.singleton.networkRun = true;
while (!XSingleton<XScene>.singleton.bSceneServerReady)
{
int num = waitTime;
waitTime = num + 1;
bool flag10 = XSingleton<XScene>.singleton.Error > ErrorCode.ERR_SUCCESS;
if (flag10)
{
bool flag11 = string.IsNullOrEmpty(XSingleton<XScene>.singleton.ErrorAddtional);
if (flag11)
{
XSingleton<UiUtility>.singleton.OnFatalErrorClosed(XSingleton<XScene>.singleton.Error);
}
else
{
XSingleton<UiUtility>.singleton.OnFatalErrorClosed(string.Format(XStringDefineProxy.GetString(XSingleton<XScene>.singleton.Error), XSingleton<XScene>.singleton.ErrorAddtional));
}
XSingleton<XScene>.singleton.Error = ErrorCode.ERR_SUCCESS;
XSingleton<XScene>.singleton.ErrorAddtional = null;
XSingleton<XClientNetwork>.singleton.CloseOnServerErrorNtf = false;
break;
}
bool flag12 = XSingleton<XScene>.singleton.SceneEntranceConfig != null;
if (flag12)
{
this._prograss = false;
XSingleton<XScene>.singleton.TriggerScene();
break;
}
yield return null;
}
bool bSceneServerReady = XSingleton<XScene>.singleton.bSceneServerReady;
if (bSceneServerReady)
{
this.PlayBGM(this._loading_scene_id);
XAutoFade.MakeBlack(true);
this._prograss = false;
yield return null;
DlgBase<LoadingDlg, LoadingDlgBehaviour>.singleton.HideSelf(false);
XSingleton<XScene>.singleton.TriggerScene();
yield return null;
XAutoFade.FadeIn(1f, true);
}
this._op = null;
bool flag13 = XSingleton<XScene>.singleton.SceneEntranceConfig != null;
if (flag13)
{
XSingleton<XScene>.singleton.SceneEnterTo(true);
}
XSingleton<XGame>.singleton.notLoadScene = true;
XSingleton<XGame>.singleton.switchScene = false;
XSingleton<XTimerMgr>.singleton.update = true;
Application.backgroundLoadingPriority = (ThreadPriority)2;
bool settingEnum = XSingleton<XGlobalConfig>.singleton.GetSettingEnum(ESettingConfig.ESceneUnloadResource);
if (settingEnum)
{
Resources.UnloadUnusedAssets();
}
bool flag14 = this._loading_scene_id == 1u;
if (flag14)
{
GC.Collect();
}
XSingleton<XUpdater.XUpdater>.singleton.XPlatform.MarkLoadlevelCompleted();
yield break;
}
private void Update()
{
bool flag = this._enabled && this._prograss;
if (flag)
{
this._current_progress += Mathf.Abs(this._target_progress - this._current_progress) * 0.5f;
DlgBase<LoadingDlg, LoadingDlgBehaviour>.singleton.SetLoadingProgress(this._current_progress);
}
}
private void DisplayPrograss(XSceneLoader.LoadingPhase phase, float progress)
{
bool flag = !this._prograss;
if (!flag)
{
switch (phase)
{
case XSceneLoader.LoadingPhase.Scene_Downlaod:
this._target_progress = progress * 0.1f;
break;
case XSceneLoader.LoadingPhase.Scene_Load:
this._target_progress = progress * 0.2f + 0.1f;
break;
case XSceneLoader.LoadingPhase.Scene_Build:
this._target_progress = progress * 0.4f + 0.3f;
break;
case XSceneLoader.LoadingPhase.Scene_Doc:
this._target_progress = progress * 0.2f + 0.7f;
break;
}
}
}
private XSceneLoader.AsyncSceneBuildRequest SceneBuildAsync(uint sceneID)
{
return new XSceneLoader.AsyncSceneBuildRequest
{
Pedometer = this.Preloader(sceneID)
};
}
private IEnumerator Preloader(uint sceneID)
{
IEnumerator ietr = null;
this._asbr.Progress = 0f;
yield return null;
XSingleton<XScene>.singleton.OnSceneLoaded(sceneID);
this._asbr.Progress = 0.05f;
yield return null;
ietr = this.PreLoadSceneMonster(sceneID);
while (ietr.MoveNext())
{
this._asbr.Progress = 0.05f + this._sub_progress * 0.75f;
yield return null;
}
ietr = this.PreLoadSceneRes(sceneID);
while (ietr.MoveNext())
{
this._asbr.Progress = 0.8f + this._sub_progress * 0.1f;
yield return null;
}
ietr = this.PlaceSceneNpc(sceneID);
while (ietr.MoveNext())
{
this._asbr.Progress = 0.9f + this._sub_progress * 0.1f;
yield return null;
}
this._asbr.Progress = 1f;
yield break;
}
private void CreatePlayer()
{
this._sub_progress = 0f;
XSingleton<XDebug>.singleton.AddLog("Preload Player", null, null, null, null, null, XDebugColor.XDebug_None);
XSingleton<XEntityMgr>.singleton.Add(XSingleton<XEntityMgr>.singleton.CreatePlayer(Vector3.zero, Quaternion.identity, false, XSingleton<XScene>.singleton.IsMustTransform || this._LoadingSpectateScene));
this._LoadingSpectateScene = false;
}
private IEnumerator PlaceSceneNpc(uint sceneID)
{
this._sub_progress = 0f;
List<uint> npcList = XSingleton<XEntityMgr>.singleton.GetNpcs(sceneID);
bool flag = npcList != null && npcList.Count > 0;
if (flag)
{
int step = 0;
XTaskDocument taskDoc = XDocuments.GetSpecificDocument<XTaskDocument>(XTaskDocument.uuID);
int num;
for (int i = 0; i < npcList.Count; i = num + 1)
{
num = step;
step = num + 1;
bool flag2 = !taskDoc.ShouldNpcExist(npcList[i]);
if (!flag2)
{
XSingleton<XEntityMgr>.singleton.CreateNpc(npcList[i], true);
this._sub_progress = (float)step / (float)npcList.Count;
}
num = i;
}
taskDoc = null;
}
this._sub_progress = 1f;
yield return null;
yield break;
}
private IEnumerator PreLoadSceneMonster(uint sceneID)
{
this._sub_progress = 0f;
List<uint> prefabs = new List<uint>();
XLevelSpawnInfo spawner = XSingleton<XLevelSpawnMgr>.singleton.GetSpawnerBySceneID(sceneID);
bool flag = spawner != null;
if (flag)
{
Dictionary<int, int> preloadInfo = new Dictionary<int, int>();
foreach (KeyValuePair<int, int> keyValuePair in spawner._preloadInfo)
{
bool flag2 = keyValuePair.Key == 0;
if (!flag2)
{
preloadInfo.Add(keyValuePair.Key, keyValuePair.Value);
//!
// keyValuePair = default(KeyValuePair<int, int>);
}
}
Dictionary<int, int>.Enumerator enumerator = default(Dictionary<int, int>.Enumerator);
bool flag3 = !XSingleton<XLevelSpawnMgr>.singleton.ForcePreloadOneWave;
if (flag3)
{
int i = 0;
while (i < XSingleton<XLevelSpawnMgr>.singleton.MonsterIDs.Count && preloadInfo.Count < XSingleton<XLevelSpawnMgr>.singleton.MaxPreloadCount)
{
bool flag4 = XSingleton<XLevelSpawnMgr>.singleton.MonsterIDs[i] == 0u;
if (!flag4)
{
bool flag5 = !preloadInfo.ContainsKey((int)XSingleton<XLevelSpawnMgr>.singleton.MonsterIDs[i]);
if (flag5)
{
preloadInfo.Add((int)XSingleton<XLevelSpawnMgr>.singleton.MonsterIDs[i], 1);
}
}
int num = i + 1;
i = num;
}
}
int step = 0;
float progress = 0f;
foreach (KeyValuePair<int, int> keyValuePair2 in preloadInfo)
{
int num = step;
step = num + 1;
progress = (float)step / (float)preloadInfo.Count * 0.9f;
uint enemyID = (uint)keyValuePair2.Key;
XEntityStatistics.RowData data = XSingleton<XEntityMgr>.singleton.EntityStatistics.GetByID(enemyID);
bool flag6 = data == null;
if (flag6)
{
XSingleton<XDebug>.singleton.AddErrorLog("Cant find statistic id: ", enemyID.ToString(), null, null, null, null);
}
else
{
XEntityPresentation.RowData presentData = XSingleton<XEntityMgr>.singleton.EntityInfo.GetByPresentID(data.PresentID);
bool flag7 = presentData == null;
if (flag7)
{
XSingleton<XDebug>.singleton.AddErrorLog("Cant find present id ", data.PresentID.ToString(), " while statistic id = ", data.ID.ToString(), null, null);
}
else
{
string prefab = presentData.Prefab;
bool flag8 = !prefabs.Contains(data.PresentID);
if (flag8)
{
string location = "Prefabs/" + prefab;
float diff = progress - this._sub_progress;
XSingleton<XResourceLoaderMgr>.singleton.CreateInAdvance(location, 1, ECreateHideType.DisableAnim);
this._sub_progress += diff * 0.2f;
XSingleton<XDebug>.singleton.AddLog("Preload ", prefab, " with pid ", data.PresentID.ToString(), null, null, XDebugColor.XDebug_None);
XSingleton<XEntityMgr>.singleton.PreloadTemp(data.PresentID, enemyID, (EntitySpecies)data.Type);
this._sub_progress += diff * 0.7f;
prefabs.Add(data.PresentID);
location = null;
}
this._sub_progress = progress;
bool flag9 =(int) Application.platform == 7 || Application.platform == 0;
if (flag9)
{
yield return null;
}
data = null;
presentData = null;
prefab = null;
//!
//keyValuePair2 = default(KeyValuePair<int, int>);
}
}
}
Dictionary<int, int>.Enumerator enumerator2 = default(Dictionary<int, int>.Enumerator);
this._sub_progress = 0.9f;
XSingleton<XResourceLoaderMgr>.singleton.CreateInAdvance(XCombatHUDMgr.HUD_NORMAL, 10, ECreateHideType.NotHide);
XSingleton<XResourceLoaderMgr>.singleton.CreateInAdvance(XCombatHUDMgr.HUD_CRITICAL, 5, ECreateHideType.NotHide);
XSingleton<XResourceLoaderMgr>.singleton.CreateInAdvance(XCombatHUDMgr.HUD_PLAYER, 5, ECreateHideType.NotHide);
this._sub_progress = 1f;
preloadInfo = null;
}
bool flag10 = XSingleton<XScene>.singleton.SceneType == SceneType.SCENE_HALL;
if (flag10)
{
XBillBoardDocument.PreLoad(16);
XSingleton<XGameUI>.singleton.m_uiTool.PreLoad(true);
}
else
{
bool flag11 = XSingleton<XScene>.singleton.SceneType == SceneType.SCENE_LOGIN;
if (!flag11)
{
XSingleton<XGameUI>.singleton.m_uiTool.PreLoad(true);
}
}
yield return null;
this._sub_progress = 1f;
yield break;
yield break;
}
private IEnumerator PreLoadSceneRes(uint sceneID)
{
this._sub_progress = 0f;
bool flag = sceneID > 3u;
if (flag)
{
PreloadAnimationList.RowData[] Anims = XSingleton<XSceneMgr>.singleton.AnimReader.Table;
int step = 0;
int i = 0;
int imax = Anims.Length;
while (i < imax)
{
this._sub_progress = 0.5f + (float)step / ((float)Anims.Length * 2f);
PreloadAnimationList.RowData rowData = Anims[i];
bool flag2 = rowData.SceneID == 0 || (long)rowData.SceneID == (long)((ulong)sceneID);
int num;
if (flag2)
{
num = step;
step = num + 1;
XSingleton<XResourceLoaderMgr>.singleton.GetXAnimation(rowData.AnimName, true, true);
yield return null;
}
rowData = null;
num = i + 1;
i = num;
}
Anims = null;
}
this._sub_progress = 1f;
yield break;
}
private void PlayBGM(uint sceneid)
{
string sceneBGM = XSingleton<XSceneMgr>.singleton.GetSceneBGM(sceneid);
XSingleton<XAudioMgr>.singleton.PlayBGM(sceneBGM);
}
private IEnumerator DocPreload(uint sceneid)
{
this._sub_progress = 0f;
int num;
for (int i = 0; i < XSingleton<XGame>.singleton.Doc.Components.Count; i = num + 1)
{
XSingleton<XGame>.singleton.Doc.Components[i].OnEnterScene();
this._sub_progress = (float)i / (float)XSingleton<XGame>.singleton.Doc.Components.Count;
num = i;
}
yield return null;
this._sub_progress = 1f;
yield break;
}
private string GetMyProfessionLoadingPic()
{
uint num = XSingleton<XAttributeMgr>.singleton.XPlayerData.TypeID % 10u;
string[] array = XSingleton<XGlobalConfig>.singleton.GetValue("ProfessionLoadingPic").Split(XGlobalConfig.AllSeparators);
bool flag = array.Length % 2 != 0;
string result;
if (flag)
{
result = "";
}
else
{
for (int i = 0; i < array.Length; i += 2)
{
bool flag2 = uint.Parse(array[i]) == num;
if (flag2)
{
return array[i + 1];
}
}
result = "";
}
return result;
}
}
}
|