Manager.cs 42 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535
  1. using LitJson;
  2. using UnityEngine;
  3. using UnityEngine.UI;
  4. using UnityEngine.Events;
  5. using UnityEngine.Analytics;
  6. using UnityEngine.EventSystems;
  7. using System;
  8. using System.Xml;
  9. using System.Collections;
  10. using System.Collections.Generic;
  11. public class Manager : Regist
  12. {
  13. #region Config
  14. #region 成就
  15. public static double PlayADsAmt
  16. {
  17. get { return playADsAmt; }
  18. set
  19. {
  20. playADsAmt = value;
  21. AchieveManager.UpdateStatus(AchieveType.PlayADsAmt, playADsAmt);
  22. }
  23. }
  24. private static double playADsAmt;
  25. public static double UseSkillAmt
  26. {
  27. get { return useSkillAmt; }
  28. set
  29. {
  30. useSkillAmt = value;
  31. AchieveManager.UpdateStatus(AchieveType.UseSkillAmt, useSkillAmt);
  32. }
  33. }
  34. private static double useSkillAmt;
  35. public static double SignAmt
  36. {
  37. get { return signAmt; }
  38. set
  39. {
  40. signAmt = value;
  41. AchieveManager.UpdateStatus(AchieveType.SignAmt, signAmt);
  42. }
  43. }
  44. private static double signAmt;
  45. public static double CloseAmt
  46. {
  47. get { return closeAmt; }
  48. set
  49. {
  50. closeAmt = value;
  51. AchieveManager.UpdateStatus(AchieveType.CloseAmt, closeAmt);
  52. }
  53. }
  54. private static double closeAmt;
  55. public static double ShareAmt
  56. {
  57. get { return shareAmt; }
  58. set
  59. {
  60. shareAmt = value;
  61. AchieveManager.UpdateStatus(AchieveType.ShareAmt, shareAmt);
  62. }
  63. }
  64. private static double shareAmt;
  65. public static double PlayMinigameAmt
  66. {
  67. get { return playMinigameAmt; }
  68. set
  69. {
  70. playMinigameAmt = value;
  71. AchieveManager.UpdateStatus(AchieveType.PlayMinigameAmt, playMinigameAmt);
  72. }
  73. }
  74. private static double playMinigameAmt;
  75. public static double AllElfLevel
  76. {
  77. get { return allElfLevel; }
  78. set
  79. {
  80. allElfLevel = value;
  81. AchieveManager.UpdateStatus(AchieveType.AllElfLevel, allElfLevel);
  82. }
  83. }
  84. private static double allElfLevel;
  85. public static double TotalCoin
  86. {
  87. get { return totalCoin; }
  88. set
  89. {
  90. totalCoin = value;
  91. AchieveManager.UpdateStatus(AchieveType.TotalCoin, totalCoin);
  92. }
  93. }
  94. private static double totalCoin;
  95. public static double TotalFlowerAwardCoin
  96. {
  97. get { return totalFlowerAwardCoin; }
  98. set
  99. {
  100. totalFlowerAwardCoin = value;
  101. AchieveManager.UpdateStatus(AchieveType.TotalFlowerAwardCoin, totalFlowerAwardCoin);
  102. }
  103. }
  104. private static double totalFlowerAwardCoin;
  105. public static double TotalVisitPerson
  106. {
  107. get { return totalVisitPerson; }
  108. set
  109. {
  110. totalVisitPerson = value;
  111. AchieveManager.UpdateStatus(AchieveType.TotalVisitPerson, totalVisitPerson);
  112. }
  113. }
  114. private static double totalVisitPerson;
  115. public static double TotalSpendDiamond
  116. {
  117. get { return totalSpendDiamond; }
  118. set
  119. {
  120. totalSpendDiamond = value;
  121. AchieveManager.UpdateStatus(AchieveType.TotalSpendDiamond, totalSpendDiamond);
  122. }
  123. }
  124. private static double totalSpendDiamond;
  125. public static double CreateRoomAmt
  126. {
  127. get { return createRoomAmt; }
  128. set
  129. {
  130. createRoomAmt = value;
  131. AchieveManager.UpdateStatus(AchieveType.CreateRoomAmt, createRoomAmt);
  132. }
  133. }
  134. private static double createRoomAmt;
  135. public static double CreateChestAmt
  136. {
  137. get { return createChestAmt; }
  138. set
  139. {
  140. createChestAmt = value;
  141. AchieveManager.UpdateStatus(AchieveType.CreateChestAmt, createChestAmt);
  142. }
  143. }
  144. private static double createChestAmt;
  145. public static double CreateLuckyChestAmt
  146. {
  147. get { return createLuckyChestAmt; }
  148. set
  149. {
  150. createLuckyChestAmt = value;
  151. AchieveManager.UpdateStatus(AchieveType.CreateLuckyChestAmt, createLuckyChestAmt);
  152. }
  153. }
  154. private static double createLuckyChestAmt;
  155. public static double CreateGuessColorChestAmt
  156. {
  157. get { return createGuessColorChestAmt; }
  158. set
  159. {
  160. createGuessColorChestAmt = value;
  161. AchieveManager.UpdateStatus(AchieveType.CreateGuessColorChestAmt, createGuessColorChestAmt);
  162. }
  163. }
  164. private static double createGuessColorChestAmt;
  165. public static double CreateGuessNumberChestAmt
  166. {
  167. get { return createGuessNumberChestAmt; }
  168. set
  169. {
  170. createGuessNumberChestAmt = value;
  171. AchieveManager.UpdateStatus(AchieveType.CreateGuessNumberChestAmt, createGuessNumberChestAmt);
  172. }
  173. }
  174. private static double createGuessNumberChestAmt;
  175. public static double GetChestAwardAmt
  176. {
  177. get { return getChestAwardAmt; }
  178. set
  179. {
  180. getChestAwardAmt = value;
  181. AchieveManager.UpdateStatus(AchieveType.GetChestAwardAmt, getChestAwardAmt);
  182. }
  183. }
  184. private static double getChestAwardAmt;
  185. #endregion
  186. public static Action<int> OnLevelChange;
  187. public static Action<double> OnCoinChange;
  188. public static Action<double> OnDiamondChange;
  189. public static int GardenLevel
  190. {
  191. get { return gardenLevel; }
  192. set
  193. {
  194. gardenLevel = value;
  195. if (!Inited)
  196. {
  197. return;
  198. }
  199. LanguageManager.Add(ResourceManager.Get<Text>(CanvasLabel.C_LevelText), new MulLanStr(LanguageLabel.UI__C_Level), gardenLevel.ToString());
  200. VisitManager.UpdateVisitCost();
  201. AchieveManager.UpdateStatus(AchieveType.GardenLevel, gardenLevel);
  202. for (int i = 0; i < SkillList.Count; i++)
  203. {
  204. SkillList[i].UpdateStatus();
  205. }
  206. foreach (var kv in PlayerManager.CloseItemDictionary)
  207. {
  208. kv.Value.OnLevelChange();
  209. }
  210. if (OnLevelChange != null)
  211. {
  212. OnLevelChange.Invoke(gardenLevel);
  213. }
  214. if (gardenLevel >= TutorialManager.MemoryMinigameTutorialLevel)
  215. {
  216. if (TutorialManager.memoryMinigameTutorial)
  217. {
  218. TutorialManager.MemoryMinigameTutorial = true;
  219. }
  220. }
  221. if (GardenLevel < TutorialManager.DressroomTutorialLevel)
  222. {
  223. ResourceManager.Get<Image>(CanvasLabel.C_DressRoom).material = Lib.GrayMat;
  224. }
  225. else
  226. {
  227. ResourceManager.Get<Image>(CanvasLabel.C_DressRoom).material = null;
  228. }
  229. if (GardenManager.TotalUnlockFlower >= TutorialManager.MinFlowerForFindSoloGame && gardenLevel >= TutorialManager.FindSoloMinigameTutorialLevel)
  230. {
  231. if (TutorialManager.findSoloMinigameTutorial)
  232. {
  233. TutorialManager.PlayFindSoloGame();
  234. }
  235. }
  236. if (GardenManager.TotalUnlockFlower >= TutorialManager.MinFlowerForFindMissingGame && gardenLevel >= TutorialManager.FindMissingMinigameTutorialLevel)
  237. {
  238. if (TutorialManager.findMissingMinigameTutorial)
  239. {
  240. TutorialManager.PlayFindMissingGame();
  241. }
  242. }
  243. if (gardenLevel >= TutorialManager.CommentTutorialLevel)
  244. {
  245. ResourceManager.Get(CanvasLabel.C_CommentParent).TweenForCG();
  246. }
  247. if (gardenLevel >= TutorialManager.VisitTutorialLevel)
  248. {
  249. if (TutorialManager.visitTutorial)
  250. {
  251. TutorialManager.ClickVisitBtn();
  252. return;
  253. }
  254. else
  255. {
  256. ResourceManager.SetActive(CanvasLabel.C_Visit, true);
  257. }
  258. }
  259. if (gardenLevel >= TutorialManager.DressroomTutorialLevel)
  260. {
  261. if (TutorialManager.dressroomTutorial)
  262. {
  263. TutorialManager.ClickDressroomButton();
  264. return;
  265. }
  266. }
  267. if (gardenLevel >= TutorialManager.PlazaRoomTutorialLevel)
  268. {
  269. if (TutorialManager.plazaRoomTutorial)
  270. {
  271. TutorialManager.ClickPlazaRoomBtn();
  272. return;
  273. }
  274. else
  275. {
  276. ResourceManager.SetActive(CanvasLabel.C_EnterPlazaRoom, true);
  277. ResourceManager.SetActive(CanvasLabel.C_EnterPlazaRoom0, true);
  278. }
  279. }
  280. if (gardenLevel >= TutorialManager.FashionShowTutorialLevel)
  281. {
  282. if (TutorialManager.fashionShowTutorial)
  283. {
  284. TutorialManager.BeginFashionShowTutorial();
  285. return;
  286. }
  287. }
  288. }
  289. }
  290. private static int gardenLevel;
  291. public static float Person
  292. {
  293. get { return person; }
  294. set
  295. {
  296. person = value;
  297. ResourceManager.SetText(CanvasLabel.F_PersonLab, Auxiliary.ShrinkBigNumberStr(CurrentPerson*60));
  298. }
  299. }
  300. private static float person;
  301. public static List<string> ExtraPersonSourceSpritesName = new List<string>();
  302. public static float CoinPerson
  303. {
  304. get { return coinPerson; }
  305. set
  306. {
  307. coinPerson = value;
  308. ResourceManager.SetText(CanvasLabel.F_CoinPersonLab, Auxiliary.ShrinkBigNumberStr(CurrentCoinPerson));
  309. }
  310. }
  311. private static float coinPerson;
  312. public static List<string> ExtraCoinPersonSourceSpritesName = new List<string>();
  313. public static float SkillPerson
  314. {
  315. get { return skillPerson; }
  316. set
  317. {
  318. skillPerson = value;
  319. //TweenOutline tween = ResourceManager.Get(CanvasLabel.F_PersonLab).GetTweenOutline();
  320. //if (skillPerson.Equal(0))
  321. //{
  322. // tween.Pause();
  323. // tween.Target.enabled = false;
  324. //}
  325. //else
  326. //{
  327. // if (tween.InPause)
  328. // {
  329. // tween.Resume();
  330. // tween.Target.enabled = true;
  331. // }
  332. // else
  333. // {
  334. // tween.StartForward();
  335. // }
  336. //}
  337. Person = Person;
  338. }
  339. }
  340. public static float skillPerson;
  341. public static float TempSkillPerson
  342. {
  343. get { return tempSkillPerson; }
  344. set
  345. {
  346. tempSkillPerson = value;
  347. TweenOutline tween = ResourceManager.Get(CanvasLabel.F_PersonLab).GetTweenOutline();
  348. if (tempSkillPerson.Equal(0) && tempSkillPersonBuff.Equal(0))
  349. {
  350. tween.Pause();
  351. tween.Target.enabled = false;
  352. }
  353. else
  354. {
  355. if (tween.InPause)
  356. {
  357. tween.Resume();
  358. tween.Target.enabled = true;
  359. }
  360. else
  361. {
  362. tween.StartForward();
  363. }
  364. }
  365. Person = Person;
  366. }
  367. }
  368. public static float tempSkillPerson;
  369. public static float SkillPersonBuff
  370. {
  371. get { return skillPersonBuff; }
  372. set
  373. {
  374. skillPersonBuff = value;
  375. Person = Person;
  376. }
  377. }
  378. public static float skillPersonBuff;
  379. public static float TempSkillPersonBuff
  380. {
  381. get { return tempSkillPersonBuff; }
  382. set
  383. {
  384. tempSkillPersonBuff = value;
  385. TweenOutline tween = ResourceManager.Get(CanvasLabel.F_PersonLab).GetTweenOutline();
  386. if (tempSkillPerson.Equal(0) && tempSkillPersonBuff.Equal(0))
  387. {
  388. tween.Pause();
  389. tween.Target.enabled = false;
  390. }
  391. else
  392. {
  393. if (tween.InPause)
  394. {
  395. tween.Resume();
  396. tween.Target.enabled = true;
  397. }
  398. else
  399. {
  400. tween.StartForward();
  401. }
  402. }
  403. Person = Person;
  404. }
  405. }
  406. public static float tempSkillPersonBuff;
  407. public static float SkillCoinPerson
  408. {
  409. get { return skillCoinPerson; }
  410. set
  411. {
  412. skillCoinPerson = value;
  413. CoinPerson = CoinPerson;
  414. }
  415. }
  416. public static float skillCoinPerson;
  417. public static float TempSkillCoinPerson
  418. {
  419. get { return tempSkillCoinPerson; }
  420. set
  421. {
  422. tempSkillCoinPerson = value;
  423. TweenOutline tween = ResourceManager.Get(CanvasLabel.F_CoinPersonLab).GetTweenOutline();
  424. if (tempSkillCoinPerson.Equal(0) && tempSkillCoinPersonBuff.Equal(0))
  425. {
  426. tween.Pause();
  427. tween.Target.enabled = false;
  428. }
  429. else
  430. {
  431. if (tween.InPause)
  432. {
  433. tween.Resume();
  434. tween.Target.enabled = true;
  435. }
  436. else
  437. {
  438. tween.StartForward();
  439. }
  440. }
  441. CoinPerson = CoinPerson;
  442. }
  443. }
  444. public static float tempSkillCoinPerson;
  445. public static float SkillCoinPersonBuff
  446. {
  447. get { return skillCoinPersonBuff; }
  448. set
  449. {
  450. skillCoinPersonBuff = value;
  451. CoinPerson = CoinPerson;
  452. }
  453. }
  454. public static float skillCoinPersonBuff;
  455. public static float TempSkillCoinPersonBuff
  456. {
  457. get { return tempSkillCoinPersonBuff; }
  458. set
  459. {
  460. tempSkillCoinPersonBuff = value;
  461. TweenOutline tween = ResourceManager.Get(CanvasLabel.F_CoinPersonLab).GetTweenOutline();
  462. if (tempSkillCoinPersonBuff.Equal(0) && tempSkillCoinPerson.Equal(0))
  463. {
  464. tween.Pause();
  465. tween.Target.enabled = false;
  466. }
  467. else
  468. {
  469. if (tween.InPause)
  470. {
  471. tween.Resume();
  472. tween.Target.enabled = true;
  473. }
  474. else
  475. {
  476. tween.StartForward();
  477. }
  478. }
  479. CoinPerson = CoinPerson;
  480. }
  481. }
  482. public static float tempSkillCoinPersonBuff;
  483. public static float IncomeBuff
  484. {
  485. get { return SkillCoinPersonBuff + FlowerPlus; }
  486. }
  487. public static float FlowerPlus
  488. {
  489. get { return flowerPlus; }
  490. set
  491. {
  492. flowerPlus = value;
  493. }
  494. }
  495. public static float flowerPlus;
  496. public static float CurrentPerson
  497. {
  498. get
  499. {
  500. //Debug.Log(Person * (1 + SkillPersonBuff + TempSkillPersonBuff) + SkillPerson + TempSkillPerson);
  501. return Person*(1 + SkillPersonBuff + TempSkillPersonBuff) + SkillPerson + TempSkillPerson;
  502. }
  503. }
  504. public static float CurrentCoinPerson
  505. {
  506. get
  507. {
  508. //Debug.Log(CoinPerson * (1 + SkillCoinPersonBuff + TempSkillCoinPersonBuff) + SkillCoinPerson + TempSkillCoinPerson);
  509. return CoinPerson*(1 + SkillCoinPersonBuff + TempSkillCoinPersonBuff) + SkillCoinPerson + TempSkillCoinPerson;
  510. }
  511. }
  512. public static double Coin
  513. {
  514. get { return coin; }
  515. set
  516. {
  517. coin = value;
  518. ResourceManager.SetText(CanvasLabel.F_CoinLab, Auxiliary.ShrinkBigNumberStr(coin));
  519. ResourceManager.SetText(CanvasLabel.C_CoinLab, Auxiliary.ShrinkBigNumberStr(coin));
  520. ResourceManager.SetText(CanvasLabel.P_CoinLab, Auxiliary.ShrinkBigNumberStr(coin));
  521. AchieveManager.UpdateStatus(AchieveType.CurrentCoin, coin);
  522. OnCoinChange.SafeInvoke(coin);
  523. }
  524. }
  525. public static double coin;
  526. public static double Diamond
  527. {
  528. get { return diamond; }
  529. set
  530. {
  531. diamond = value;
  532. ResourceManager.SetText(CanvasLabel.F_DiamondLab, Auxiliary.ShrinkBigNumberStr(diamond));
  533. ResourceManager.SetText(CanvasLabel.P_DiamondLab, Auxiliary.ShrinkBigNumberStr(diamond));
  534. OnDiamondChange.SafeInvoke(diamond);
  535. }
  536. }
  537. public static double diamond;
  538. public static bool MinigameFlag;
  539. public static bool UploadConfigFlag;
  540. public static bool LoginFlag;
  541. public static bool ReactiveFlag;
  542. public static bool DownloadConfigFlag;
  543. public static bool SceneSwitchFlag;
  544. public static bool Inited;
  545. public static bool IsFirstFrame = true;
  546. public static bool InBackground;
  547. public static float IncomeDisplayTime = 60f;
  548. public static float IncomeCircleTime = 10;
  549. public static float IncomeCircleTimer;
  550. public static float CircleIncome
  551. {
  552. get
  553. {
  554. return CurrentPerson * IncomeCircleTime * CurrentCoinPerson * (1 + FlowerPlus);
  555. }
  556. }
  557. public static float GameBeginTime;
  558. public static bool AlreadyGetOfflineIncome;
  559. public static bool OfflineFlag;
  560. public static float OfflineTime;
  561. public static string OfflineIncomeFml;
  562. public static double OfflineMaxCoin;
  563. public static double OfflineMaxTime;
  564. public static double OfflineMinTime = 120;
  565. public static float InputDetectTime = 60f;
  566. public static float InputDetectTimer;
  567. public static float LoginTime = 10f;
  568. public static float LoginTimer;
  569. public static float MinigameCDTimer;
  570. public static float UploadConfigTime = 60f;
  571. public static float UploadConfigTimer;
  572. public static Manager Instance;
  573. public static DateTime LastQuitTime;
  574. public static List<Skill> UsingSkillList = new List<Skill>();
  575. public static List<Skill> CoolSkillList = new List<Skill>();
  576. public static List<Skill> OfflineCoolSkillList = new List<Skill>();
  577. public static List<List<Skill>> OfflineUsingSkillList = new List<List<Skill>>();
  578. public static List<SkillRoot> SkillList = new List<SkillRoot>();
  579. public static Dictionary<string, SkillRoot> SkillDictionary = new Dictionary<string, SkillRoot>();
  580. #endregion
  581. private void Update()
  582. {
  583. LoginThread();
  584. if (TutorialManager.NewplayerTutorial)
  585. {
  586. return;
  587. }
  588. InputDetectThread();
  589. ProcessSkillThread();
  590. MinigameCDThread();
  591. UploadConfigThread();
  592. IncomeCircleThread();
  593. }
  594. private void InputDetectThread()
  595. {
  596. //if (VisitManager.InVisit)
  597. //{
  598. // return;
  599. //}
  600. if (Auxiliary.AnyKeyUp)
  601. {
  602. InputDetectTimer = 0;
  603. ResourceManager.Get(CanvasLabel.C_Group).TweenForCG();
  604. }
  605. else
  606. {
  607. InputDetectTimer += Time.deltaTime;
  608. if (InputDetectTimer >= InputDetectTime)
  609. {
  610. InputDetectTimer = 0;
  611. ResourceManager.Get(CanvasLabel.C_Group).TweenBacCG();
  612. }
  613. }
  614. }
  615. private void ProcessSkillThread()
  616. {
  617. for (int i = 0; i < UsingSkillList.Count; i++)
  618. {
  619. if (UsingSkillList[i].DoUpdate())
  620. {
  621. UsingSkillList.RemoveAt(i--);
  622. }
  623. }
  624. for (int i = 0; i < CoolSkillList.Count; i++)
  625. {
  626. if (CoolSkillList[i].DoCD())
  627. {
  628. CoolSkillList.RemoveAt(i--);
  629. }
  630. }
  631. }
  632. private void MinigameCDThread()
  633. {
  634. if (!MinigameFlag)
  635. {
  636. MinigameCDTimer -= Time.deltaTime;
  637. ResourceManager.SetText(CanvasLabel.C_MiniGameLab, Mathf.CeilToInt(MinigameCDTimer).ToString());
  638. if (MinigameCDTimer < 0)
  639. {
  640. MinigameFlag = true;
  641. ResourceManager.Get(CanvasLabel.C_MiniGame).TweenBacRect();
  642. CDMinigamePanelManager.EnableCDButton();
  643. ResourceManager.SetText(CanvasLabel.C_MiniGameLab, "");
  644. StaticsManager.GetInstance().RewardItem(StaticsManager.ItemID.获得小游戏, StaticsManager.ItemType.小游戏, "1", StaticsManager.ConsumeModule.None);
  645. }
  646. }
  647. }
  648. private void UploadConfigThread()
  649. {
  650. if (DownloadConfigFlag)
  651. {
  652. return;
  653. }
  654. UploadConfigTimer += Time.deltaTime;
  655. if (UploadConfigTimer >= UploadConfigTime)
  656. {
  657. UploadConfigTimer = 0;
  658. if (!PlayerPrefManager.GetBool(PlayerPrefManager.INTERACT_CONFIG, false))
  659. {
  660. HttpManager.GetSelfConfig();
  661. }
  662. else
  663. {
  664. HttpManager.UploadConfig();
  665. }
  666. }
  667. }
  668. private void LoginThread()
  669. {
  670. LoginTimer += Time.deltaTime;
  671. if (LoginTimer >= LoginTime)
  672. {
  673. LoginTimer = 0;
  674. HttpManager.Login();
  675. StaticsManager.GetInstance().Online();
  676. }
  677. }
  678. private void IncomeCircleThread()
  679. {
  680. IncomeCircleTimer -= Time.deltaTime;
  681. if (IncomeCircleTimer < 0)
  682. {
  683. IncomeCircleTimer = IncomeCircleTime;
  684. TotalVisitPerson += CurrentPerson * IncomeCircleTime;
  685. float circleIncome = CircleIncome;
  686. AddCoin(circleIncome, StaticsManager.ItemID.获得金币, StaticsManager.ConsumeModule.Income);
  687. ResourceManager.Get(CanvasLabel.C_IncomeLab).TweenReForGra();
  688. ResourceManager.Get(CanvasLabel.C_IncomeLab).TweenReForVec();
  689. ResourceManager.SetText(CanvasLabel.C_IncomeLab, "+" + Auxiliary.ShrinkBigNumberStr(circleIncome, 0));
  690. }
  691. }
  692. public static void AddCoin(double amt, StaticsManager.ItemID itemId, StaticsManager.ConsumeModule consumeModule)
  693. {
  694. Coin += amt;
  695. if (amt > 0)
  696. {
  697. TotalCoin += amt;
  698. StaticsManager.GetInstance().RewardItem(itemId, StaticsManager.ItemType.金币, amt.ToString("0"), consumeModule);
  699. }
  700. }
  701. public static void AddDiamond(double amt, StaticsManager.ItemID itemId, StaticsManager.ConsumeModule consumeModule)
  702. {
  703. Diamond += amt;
  704. if (amt > 0)
  705. {
  706. StaticsManager.GetInstance().RewardItem(itemId, StaticsManager.ItemType.钻石, amt.ToString("0"), consumeModule);
  707. }
  708. }
  709. public override void Reactive()
  710. {
  711. foreach (var kv in SkillDictionary)
  712. {
  713. kv.Value.Reactive();
  714. }
  715. InitAllSkill(false);
  716. GetOfflineIncome();
  717. SignManager.ShowPanels();
  718. }
  719. public override void InstantiatePrefabs()
  720. {
  721. #region 生成技能条
  722. #region 读技能配置
  723. List<XmlAttributeCollection> attributeList = ConfigManager.GetSkillConfig();
  724. for (int i = 0; i < attributeList.Count; i++)
  725. {
  726. SkillRoot skillRoot;
  727. #region MyRegion
  728. if (attributeList[i].Count == 18)
  729. {
  730. skillRoot = new Pack(attributeList[i]);
  731. }
  732. else if (attributeList[i].Count == 24)
  733. {
  734. skillRoot = new Ability(attributeList[i]);
  735. }
  736. else if (attributeList[i].Count == 34)
  737. {
  738. if (string.IsNullOrEmpty(attributeList[i][4].Value))
  739. {
  740. skillRoot = new Skill(attributeList[i]);
  741. }
  742. else
  743. {
  744. skillRoot = new BigSkill(attributeList[i]);
  745. }
  746. }
  747. else
  748. {
  749. throw new Exception(attributeList[i].Count.ToString());
  750. }
  751. #endregion
  752. SkillDictionary.Add(skillRoot.FullID, skillRoot);
  753. SkillList.Add(skillRoot);
  754. }
  755. SkillList.Sort(SkillRoot.Sort);
  756. #endregion
  757. for (int i = 0; i < SkillList.Count; i++)
  758. {
  759. if (SkillList[i].SkillTab != SkillTab.Null)
  760. {
  761. ResourceManager.GetSkillItem(SkillList[i]);
  762. }
  763. }
  764. #endregion
  765. }
  766. public override void FirstInit()
  767. {
  768. ResourceManager.Get<Graphic>(CanvasLabel.F_Elf).material = Lib.GrayMat;
  769. ResourceManager.Get<Graphic>(CanvasLabel.F_Store).material = Lib.GrayMat;
  770. ResourceManager.Get<Graphic>(CanvasLabel.F_Magic).material = Lib.GrayMat;
  771. ResourceManager.Get<Graphic>(CanvasLabel.F_ElfLab).material = Lib.GrayMat;
  772. ResourceManager.Get<Graphic>(CanvasLabel.F_StoreLab).material = Lib.GrayMat;
  773. ResourceManager.Get<Graphic>(CanvasLabel.F_MagicLab).material = Lib.GrayMat;
  774. ResourceManager.Get<Button>(CanvasLabel.F_Elf).interactable = false;
  775. ResourceManager.Get<Button>(CanvasLabel.F_Store).interactable = false;
  776. ResourceManager.Get<Button>(CanvasLabel.F_Magic).interactable = false;
  777. List<XmlAttributeCollection> attributeList = ConfigManager.GetSkillList();
  778. for (int i = 0; i < attributeList.Count; i++)
  779. {
  780. SkillRoot skillRoot = SkillDictionary[attributeList[i][0].Value];
  781. if (!(skillRoot is Skill))
  782. {
  783. skillRoot.RegistReference();
  784. skillRoot.Init(true, OfflineTime, OfflineUsingSkillList, attributeList[i]);
  785. }
  786. }
  787. }
  788. public override void SecondInit()
  789. {
  790. Instance = this;
  791. Coin = ConfigManager.GetDoubleFormConfig(PlayerConfigLabel.Coin);
  792. Diamond = ConfigManager.GetDoubleFormConfig(PlayerConfigLabel.Diamond);
  793. MinigameCDTimer = ConfigManager.GetFloatFormConfig(PlayerConfigLabel.MiniTimer);
  794. IncomeCircleTimer = ConfigManager.GetFloatFormConfig(PlayerConfigLabel.CircleTimer);
  795. if (MinigameCDTimer > 0)
  796. {
  797. ResourceManager.Get(CanvasLabel.C_MiniGame).TweenForRect();
  798. if (ConfigManager.GetBoolFormConfig(PlayerConfigLabel.MinigameCoolFlag))
  799. {
  800. CDMinigamePanelManager.DisableCDButton();
  801. }
  802. }
  803. else
  804. {
  805. MinigameFlag = true;
  806. }
  807. HttpManager.ID = ConfigManager.GetStringFormConfig(PlayerConfigLabel.ID);
  808. HttpManager.SerialNumber = ConfigManager.GetStringFormConfig(PlayerConfigLabel.SerialNumber);
  809. List<string> offlineList = ConfigManager.GetOfflineConfig();
  810. OfflineMaxCoin = Auxiliary.StringToLong(offlineList[1], 999999999999999999);
  811. OfflineMaxTime = Auxiliary.StringToLong(offlineList[2], 999999999999999999);
  812. OfflineIncomeFml = offlineList[0];
  813. List<double> dataList = ConfigManager.GetAchieveValues();
  814. PlayADsAmt = dataList[0];
  815. AllElfLevel = dataList[4];
  816. UseSkillAmt = dataList[1];
  817. SignAmt = dataList[2];
  818. ShareAmt = dataList[3];
  819. TotalFlowerAwardCoin = dataList[6];
  820. TotalVisitPerson = dataList[7];
  821. TotalSpendDiamond = dataList[8];
  822. PlayMinigameAmt = dataList[5];
  823. CreateRoomAmt = dataList[9];
  824. CreateChestAmt = dataList[10];
  825. CreateLuckyChestAmt = dataList[11];
  826. CreateGuessColorChestAmt = dataList[12];
  827. CreateGuessNumberChestAmt = dataList[13];
  828. GetChestAwardAmt = dataList[14];
  829. }
  830. public static void InitAllSkill(bool firstRegist)
  831. {
  832. OfflineFlag = false;
  833. float realOfflineTime = 0;
  834. ResourceManager.SetActive(CanvasLabel.Ba_Lab2, false);
  835. if (HttpManager.IsConnect && ConfigManager.GetBoolFormConfig(PlayerConfigLabel.QuitFlag))
  836. {
  837. AlreadyGetOfflineIncome = true;
  838. LastQuitTime = DateTime.Parse(ConfigManager.GetStringFormConfig(PlayerConfigLabel.QuitTime));
  839. OfflineTime = (float)HttpManager.CurrentDateTime.Subtract(LastQuitTime).TotalSeconds;
  840. MinigameCDTimer -= OfflineTime;
  841. if (OfflineTime <= OfflineMinTime)
  842. {
  843. realOfflineTime = OfflineTime;
  844. OfflineTime = 0;
  845. }
  846. else
  847. {
  848. OfflineFlag = true;
  849. }
  850. if (OfflineTime > OfflineMaxTime)
  851. {
  852. OfflineTime = (long)OfflineMaxTime;
  853. ResourceManager.SetText(CanvasLabel.Ba_Lab2, Language.GetStr(LanguageLabel.UI__Ba_Lab2));
  854. ResourceManager.SetActive(CanvasLabel.Ba_Lab2, true);
  855. }
  856. }
  857. else
  858. {
  859. if (ConfigManager.GetBoolFormConfig(PlayerConfigLabel.QuitFlag))
  860. {
  861. AlreadyGetOfflineIncome = false;
  862. LastQuitTime = DateTime.Parse(ConfigManager.GetStringFormConfig(PlayerConfigLabel.QuitTime));
  863. GameBeginTime = Time.time;
  864. }
  865. }
  866. OfflineUsingSkillList = new List<List<Skill>>();
  867. OfflineCoolSkillList = new List<Skill>();
  868. if (OfflineTime > IncomeCircleTimer)
  869. {
  870. int circle = 1 + Mathf.FloorToInt((OfflineTime - IncomeCircleTimer) / IncomeCircleTime);
  871. for (int i = 0; i < circle; i++)
  872. {
  873. OfflineUsingSkillList.Add(new List<Skill>());
  874. }
  875. }
  876. List<XmlAttributeCollection> attributeList = ConfigManager.GetSkillList();
  877. for (int i = 0; i < attributeList.Count; i++)
  878. {
  879. SkillRoot skillRoot = SkillDictionary[attributeList[i][0].Value];
  880. if (skillRoot is Skill)
  881. {
  882. skillRoot.RegistReference();
  883. skillRoot.Init(firstRegist, OfflineTime, OfflineUsingSkillList, attributeList[i]);
  884. }
  885. }
  886. if (OfflineFlag == false)
  887. {
  888. foreach (var skill in CoolSkillList)
  889. {
  890. skill.CoolTimer -= realOfflineTime;
  891. }
  892. }
  893. }
  894. public static void GetOfflineIncome()
  895. {
  896. double coin = 0;
  897. for (int i = 0; i < OfflineUsingSkillList.Count; i++)
  898. {
  899. for (int j = 0; j < OfflineCoolSkillList.Count; j++)
  900. {
  901. OfflineCoolSkillList[j].CoolTimer -= IncomeCircleTime;
  902. }
  903. for (int j = 0; j < OfflineUsingSkillList[i].Count; j++)
  904. {
  905. OfflineUsingSkillList[i][j].AnnulEffect();
  906. OfflineCoolSkillList.Add(OfflineUsingSkillList[i][j]);
  907. }
  908. TotalVisitPerson += CurrentPerson*IncomeCircleTime;
  909. coin += CircleIncome;
  910. }
  911. IncomeCircleTimer = (OfflineTime - IncomeCircleTimer)%IncomeCircleTime;
  912. for (int j = 0; j < OfflineCoolSkillList.Count; j++)
  913. {
  914. OfflineCoolSkillList[j].CoolTimer -= IncomeCircleTime - IncomeCircleTimer;
  915. }
  916. coin = (long) AdjustOfflineIncome(coin);
  917. AddCoin(coin, StaticsManager.ItemID.获得金币, StaticsManager.ConsumeModule.Income);
  918. ResourceManager.SetText(CanvasLabel.Ba_IconLab, Auxiliary.ShrinkBigNumberStr(coin));
  919. }
  920. public static double AdjustOfflineIncome(double offlineIncome)
  921. {
  922. offlineIncome = (long)Auxiliary.FmlParse(OfflineIncomeFml, "c", offlineIncome.ToString());
  923. if (offlineIncome > OfflineMaxCoin)
  924. {
  925. offlineIncome = OfflineMaxCoin;
  926. ResourceManager.SetText(CanvasLabel.Ba_Lab2, Language.GetStr(LanguageLabel.UI__Ba_Lab2));
  927. ResourceManager.SetActive(CanvasLabel.Ba_Lab2, true);
  928. }
  929. return offlineIncome;
  930. }
  931. public new static void SwitchLanguage()
  932. {
  933. Coin = Coin;
  934. AddDiamond(0, StaticsManager.ItemID.None, StaticsManager.ConsumeModule.None);
  935. }
  936. public static void Pay(string id, double amt, Current current, UnityAction succeedCallback, StaticsManager.ItemID itemId, StaticsManager.ConsumeModule consumeModule, bool navigate = true, bool useBubbleTweenNavigate = true, UnityAction navigateCall = null, int buyAmount = 1)
  937. {
  938. if (TutorialManager.PayExempt)
  939. {
  940. succeedCallback.Invoke();
  941. return;
  942. }
  943. amt = Auxiliary.ShrinkNumber(amt);
  944. if (current == Current.Free)
  945. {
  946. succeedCallback.Invoke();
  947. }
  948. else if (current == Current.AD)
  949. {
  950. IAPManager.PlayAD(succeedCallback);
  951. }
  952. else if (current == Current.Cash)
  953. {
  954. IAPManager.TryPurchase(id);
  955. }
  956. else if (current == Current.Coin)
  957. {
  958. #region MyRegion
  959. if (Coin >= amt)
  960. {
  961. Coin -= amt;
  962. succeedCallback.Invoke();
  963. StaticsManager.GetInstance().UseItem(itemId, StaticsManager.ItemType.金币, buyAmount.ToString(), consumeModule);
  964. }
  965. else
  966. {
  967. ResourceManager.Get(CanvasLabel.Fe_Info).TweenBacCG();
  968. if (navigate)
  969. {
  970. Bubble.Show
  971. (
  972. Language.GetStr(LanguageLabel.Common__ShortCoin),
  973. "",
  974. null,
  975. Lib.GoldSprite,
  976. () =>
  977. {
  978. navigateCall.SafeInvoke();
  979. if (useBubbleTweenNavigate)
  980. {
  981. TweenRoot tween = ResourceManager.Get(CanvasLabel.K_Bubble0).GetTweenScale();
  982. tween.AddEventOnetime
  983. (
  984. EventType.BackwardFinish,
  985. () =>
  986. {
  987. UIManager.NavigateToBuyCoin();
  988. }
  989. );
  990. }
  991. else
  992. {
  993. TweenRoot tween = ResourceManager.Get(CanvasLabel.F_Manage0).GetTweenVec();
  994. tween.AddEventOnetime
  995. (
  996. EventType.ForwardFinish,
  997. () =>
  998. {
  999. UIManager.NavigateToBuyCoin();
  1000. }
  1001. );
  1002. }
  1003. }
  1004. );
  1005. Bubble.Lab3.text = Language.GetStr(LanguageLabel.Common__NavigateCoin);
  1006. Bubble.Lab3.SetActive(true);
  1007. Bubble.Lab.SetActive(false);
  1008. }
  1009. else
  1010. {
  1011. Bubble.Show
  1012. (
  1013. Language.GetStr(LanguageLabel.Common__ShortCoin),
  1014. null,
  1015. null,
  1016. Lib.GoldSprite
  1017. );
  1018. }
  1019. }
  1020. #endregion
  1021. }
  1022. else if (current == Current.Diamond)
  1023. {
  1024. #region MyRegion
  1025. if (Diamond >= amt)
  1026. {
  1027. Diamond -= amt;
  1028. TotalSpendDiamond += amt;
  1029. succeedCallback.Invoke();
  1030. StaticsManager.GetInstance().PurchaseItem(itemId, StaticsManager.ItemType.钻石, buyAmount.ToString(), amt.ToString("0"), consumeModule);
  1031. }
  1032. else
  1033. {
  1034. ResourceManager.Get(CanvasLabel.Fe_Info).TweenBacCG();
  1035. if (navigate)
  1036. {
  1037. Bubble.Show
  1038. (
  1039. Language.GetStr(LanguageLabel.Common__ShortDiamond),
  1040. "",
  1041. null,
  1042. Lib.DiamondSprite,
  1043. () =>
  1044. {
  1045. navigateCall.SafeInvoke();
  1046. if (useBubbleTweenNavigate)
  1047. {
  1048. TweenRoot tween = ResourceManager.Get(CanvasLabel.K_Bubble0).GetTweenScale();
  1049. tween.AddEventOnetime
  1050. (
  1051. EventType.BackwardFinish,
  1052. () =>
  1053. {
  1054. UIManager.NavigateToBuyDiamond();
  1055. }
  1056. );
  1057. }
  1058. else
  1059. {
  1060. TweenRoot tween = ResourceManager.Get(CanvasLabel.F_Manage0).GetTweenVec();
  1061. tween.AddEventOnetime
  1062. (
  1063. EventType.ForwardFinish,
  1064. () =>
  1065. {
  1066. UIManager.NavigateToBuyDiamond();
  1067. }
  1068. );
  1069. }
  1070. }
  1071. );
  1072. Bubble.Lab3.text = Language.GetStr(LanguageLabel.Common__NavigateDiamond);
  1073. Bubble.Lab3.SetActive(true);
  1074. Bubble.Lab.SetActive(false);
  1075. }
  1076. else
  1077. {
  1078. Bubble.Show
  1079. (
  1080. Language.GetStr(LanguageLabel.Common__ShortDiamond),
  1081. null,
  1082. null,
  1083. Lib.DiamondSprite
  1084. );
  1085. }
  1086. }
  1087. #endregion
  1088. }
  1089. else
  1090. {
  1091. throw new Exception(current.ToString());
  1092. }
  1093. }
  1094. public static void FirstTimeLoginCallback(JsonData jsonData)
  1095. {
  1096. if (!Initializer.Inited || !HttpManager.Inited || Inited)
  1097. {
  1098. return;
  1099. }
  1100. HttpManager.GetBuyPackLimitFlag();
  1101. if (HttpManager.IsConnect)
  1102. {
  1103. if (ConfigManager.GetStringFormConfig(PlayerConfigLabel.ID) == PlayerConfigLabel.DefaultID)
  1104. {
  1105. HttpManager.ID = HttpManager.LoginCallbackData["o"].ToString();
  1106. ResourceManager.SetText(CanvasLabel.L_UserLab, HttpManager.ID);
  1107. }
  1108. if (ConfigManager.GetStringFormConfig(PlayerConfigLabel.SerialNumber) == PlayerConfigLabel.DefaultSerialNumber)
  1109. {
  1110. HttpManager.SerialNumber = HttpManager.LoginCallbackData["i"].ToString();
  1111. }
  1112. }
  1113. InitAllSkill(true);
  1114. GetOfflineIncome();
  1115. SignManager.ShowPanels();
  1116. Analytics.SetUserId(HttpManager.ID);
  1117. Inited = true;
  1118. GardenLevel = GardenLevel;
  1119. if (!PlayerPrefManager.GetBool(PlayerPrefManager.INTERACT_CONFIG, false))
  1120. {
  1121. HttpManager.GetSelfConfig();
  1122. }
  1123. else
  1124. {
  1125. HttpManager.UploadConfig();
  1126. }
  1127. ConfigManager.SaveConfigDocument();
  1128. ConfigManager.SaveConfigDocumentToDisk();
  1129. }
  1130. public static void ReactiveLoginCallback(JsonData jsonData)
  1131. {
  1132. LoginFlag = false;
  1133. for (int i = 0; i < Initializer.RegistList.Count; i++)
  1134. {
  1135. Initializer.RegistList[i].Reactive();
  1136. }
  1137. }
  1138. public static void SwitchConfig(string id)
  1139. {
  1140. ResourceManager.SetText(CanvasLabel.La_Lab, Language.GetStr(LanguageLabel.UI__L_Downloading));
  1141. ResourceManager.SetActive(CanvasLabel.La_Lab, true);
  1142. ResourceManager.SetActive(CanvasLabel.La_Mask, true);
  1143. HttpManager.GetConfigByID(id, SwitchConfigCallback);
  1144. }
  1145. public static void SwitchConfigCallback(JsonData jsonData)
  1146. {
  1147. if (jsonData.Inst_Object.Keys.Contains("l"))
  1148. {
  1149. ResourceManager.Get(CanvasLabel.La_Info).TweenBacCG();
  1150. ResourceManager.SetText(CanvasLabel.La_Lab, Language.GetStr(LanguageLabel.UI__La_Lab0));
  1151. ConfigManager.ConfigDocument.LoadXml(jsonData["l"].ToString());
  1152. ConfigManager.ConfigRootNode = ConfigManager.ConfigDocument.SelectSingleNode(PlayerConfigLabel.RootNode);
  1153. ResourceManager.SetText(CanvasLabel.L_UserLab, ConfigManager.GetStringFormConfig(PlayerConfigLabel.ID));
  1154. HttpManager.ID = ConfigManager.GetStringFormConfig(PlayerConfigLabel.ID);
  1155. HttpManager.SerialNumber = ConfigManager.GetStringFormConfig(PlayerConfigLabel.SerialNumber);
  1156. Debug.Log(HttpManager.ID);
  1157. Debug.Log(HttpManager.SerialNumber);
  1158. Bubble.Show(null, Language.GetStr(LanguageLabel.UI__La_Lab0), null, null, () => { Application.Quit(); }, null, false);
  1159. UploadConfigFlag = true;
  1160. DownloadConfigFlag = true;
  1161. ConfigManager.SaveConfigDocumentToDisk();
  1162. PlayerPrefs.SetString(Lib.ConfigPrefs, "");
  1163. }
  1164. else
  1165. {
  1166. ResourceManager.SetText(CanvasLabel.La_Lab, Language.GetStr(LanguageLabel.UI__La_Lab1));
  1167. ResourceManager.SetActive(CanvasLabel.La_Mask, false);
  1168. }
  1169. }
  1170. public void OnApplicationQuit()
  1171. {
  1172. if (!UploadConfigFlag)
  1173. {
  1174. VisitManager.ReverseConfigData();
  1175. ConfigManager.SaveConfigDocument();
  1176. ConfigManager.SaveConfigDocumentToDisk();
  1177. }
  1178. }
  1179. public void OnApplicationPause(bool pause)
  1180. {
  1181. if (pause)
  1182. {
  1183. InBackground = true;
  1184. AlreadyGetOfflineIncome = true;
  1185. if (DownloadConfigFlag)
  1186. {
  1187. return;
  1188. }
  1189. VisitManager.ReverseConfigData();
  1190. ConfigManager.SaveConfigDocument();
  1191. ConfigManager.SaveConfigDocumentToDisk();
  1192. }
  1193. else
  1194. {
  1195. StaticsManager.GetInstance().StartSession();
  1196. InBackground = false;
  1197. if (IsFirstFrame)
  1198. {
  1199. IsFirstFrame = false;
  1200. }
  1201. else
  1202. {
  1203. if (TutorialManager.NewplayerTutorial)
  1204. {
  1205. return;
  1206. }
  1207. if (!Initializer.Inited)
  1208. {
  1209. return;
  1210. }
  1211. if (!Initializer.IsGameActivated)
  1212. {
  1213. return;
  1214. }
  1215. if (DownloadConfigFlag)
  1216. {
  1217. return;
  1218. }
  1219. VisitManager.RecoverConfigData();
  1220. if (LoginFlag)
  1221. {
  1222. return;
  1223. }
  1224. if (ReactiveFlag)
  1225. {
  1226. ReactiveFlag = false;
  1227. return;
  1228. }
  1229. LoginFlag = true;
  1230. HttpManager.Login(ReactiveLoginCallback);
  1231. HttpManager.GetMailAwardData();
  1232. }
  1233. }
  1234. }
  1235. }