GardenManager.cs 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727
  1. using UnityEngine;
  2. using UnityEngine.UI;
  3. using UnityEngine.Events;
  4. using UnityEngine.EventSystems;
  5. using System;
  6. using System.Xml;
  7. using System.Linq;
  8. using System.Collections;
  9. using System.Collections.Generic;
  10. using Random = UnityEngine.Random;
  11. public class GardenLabel
  12. {
  13. public static string GardenBK2 = "GardenBK2";
  14. public static string GardenBK3 = "GardenBK3";
  15. public static string GardenBK4 = "GardenBK4";
  16. public static string BK2RightPos = "BK2RightPos";
  17. public static string BK2LeftPos = "BK2LeftPos";
  18. public static string BK3RightPos = "BK3RightPos";
  19. public static string BK3LeftPos = "BK3LeftPos";
  20. public static string BK4RightPos = "BK4RightPos";
  21. public static string BK4LeftPos = "BK4LeftPos";
  22. public static string MinigameLeftPos = "MinigameLeftPos";
  23. public static string GardenCloud1 = "GardenCloud1";
  24. public static string GardenCloud2 = "GardenCloud2";
  25. public static string GardenCloud3 = "GardenCloud3";
  26. public static string BirdPivot = "BirdPivot";
  27. public static string GardenLeftTree = "GardenLeftTree";
  28. public static string GardenRightTree = "GardenRightTree";
  29. public static string GardenRainbow = "GardenRainbow";
  30. public static string GardenMini = "GardenMini";
  31. public static string SlotPage = "GardenPage";
  32. public static string GardenNormal = "GardenNormal";
  33. public static string PlayerPosTra = "PlayerPosTra";
  34. public static string MiniLeft = "MiniLeft";
  35. public static string MiniRight1 = "MiniRight1";
  36. public static string MiniRight2 = "MiniRight2";
  37. public static string SlotMini1 = "SlotMini1";
  38. public static string SlotMini2 = "SlotMini2";
  39. public static string SlotMini3 = "SlotMini3";
  40. public static string SlotMini4 = "SlotMini4";
  41. public static string SlotMini5 = "SlotMini5";
  42. public static string SlotMini6 = "SlotMini6";
  43. public static string SlotMini7 = "SlotMini7";
  44. public static string SlotMini8 = "SlotMini8";
  45. public static string SlotMini9 = "SlotMini9";
  46. }
  47. public enum ElfType
  48. {
  49. Bee_Red,
  50. Bee_Blue,
  51. Bee_White,
  52. Bee_Purple,
  53. Bee_Yellow,
  54. Beetle_Red,
  55. Beetle_Blue,
  56. Beetle_White,
  57. Beetle_Purple,
  58. Beetle_Yellow,
  59. Butterfly_Red,
  60. Butterfly_Blue,
  61. Butterfly_White,
  62. Butterfly_Purple,
  63. Butterfly_Yellow,
  64. Dragonfly_Red,
  65. Dragonfly_Blue,
  66. Dragonfly_White,
  67. Dragonfly_Purple,
  68. Dragonfly_Yellow,
  69. }
  70. public class GardenManager : Regist
  71. {
  72. #region Config
  73. public static int Slot
  74. {
  75. get { return Slot_; }
  76. set
  77. {
  78. Slot_ = value;
  79. ResourceManager.SetText(ObjectLabel.G_CollectLab2, string.Format("{0}/{1}", Slot_, Page * TotalSlotAmtInOnePage));
  80. }
  81. }
  82. public static int Page
  83. {
  84. get { return PageList.Count; }
  85. }
  86. public static int MyFlower
  87. {
  88. get { return MyFlower_; }
  89. set
  90. {
  91. MyFlower_ = value;
  92. AchieveManager.UpdateStatus(AchieveType.FlowerAmt, MyFlower_);
  93. ResourceManager.SetText(ObjectLabel.F_FlowerLab, string.Format("{0}", MyFlower));
  94. ResourceManager.SetText(ObjectLabel.G_CollectLab1, string.Format("{0}/{1}", MyFlower, TotalFlower));
  95. if (MyFlower_ >= TutorialManager.MinFlowerForFindGame && Manager.Level >= TutorialManager.FindMinigameTutorialLevel)
  96. {
  97. if (TutorialManager.findMinigameTutorial)
  98. {
  99. TutorialManager.PlayFindGame();
  100. }
  101. }
  102. }
  103. }
  104. public static int MyFlowerSpec
  105. {
  106. get { return MyFlowerSpec_; }
  107. set
  108. {
  109. MyFlowerSpec_ = value;
  110. MyFlower = MyFlowerSpec_ + MyFlowerRegu_;
  111. }
  112. }
  113. public static int MyFlowerRegu
  114. {
  115. get { return MyFlowerRegu_; }
  116. set
  117. {
  118. MyFlowerRegu_ = value;
  119. MyFlower = MyFlowerSpec_ + MyFlowerRegu_;
  120. }
  121. }
  122. public static int TotalFlowerSpec
  123. {
  124. get { return TotalFlowerSpec_; }
  125. set
  126. {
  127. TotalFlowerSpec_ = value;
  128. TotalFlower = TotalFlowerSpec_ + TotalFlowerRegu_;
  129. }
  130. }
  131. public static int TotalFlowerRegu
  132. {
  133. get { return TotalFlowerRegu_; }
  134. set
  135. {
  136. TotalFlowerRegu_ = value;
  137. TotalFlower = TotalFlowerSpec_ + TotalFlowerRegu_;
  138. }
  139. }
  140. public static int Slot_;
  141. public static int DefaultSlot = 1;
  142. private static int MyFlower_;
  143. private static int MyFlowerSpec_;
  144. private static int MyFlowerRegu_;
  145. private static int TotalFlowerSpec_;
  146. private static int TotalFlowerRegu_;
  147. public static int FirstUnlockFlowerID
  148. {
  149. get
  150. {
  151. foreach (var kv in FlowerInfoDic)
  152. {
  153. if (!kv.Value.Unlock)
  154. {
  155. return kv.Key;
  156. }
  157. }
  158. return -1;
  159. }
  160. }
  161. public static List<int> UnlockedFlowerIDList
  162. {
  163. get
  164. {
  165. List<int> unlockedFlowerIDList = new List<int>();
  166. foreach (var kv in FlowerInfoDic)
  167. {
  168. if (kv.Value.Unlock)
  169. {
  170. unlockedFlowerIDList.Add(kv.Key);
  171. }
  172. }
  173. return unlockedFlowerIDList;
  174. }
  175. }
  176. public static int TotalFlower;
  177. public static bool MiniLock = true;
  178. public static float ElfTimer;
  179. public static float StarTimer;
  180. public static float AwardTimer;
  181. public static Button RetrieveButton;
  182. public static Text RetrieveButtonLab;
  183. public static Button PurchaseButton;
  184. public static Text PurchaseButtonLab;
  185. public static FlowerInfo SeleInfo;
  186. public static GardenManager Instance;
  187. public static List<Slot> SlotList = new List<Slot>();
  188. public static List<Slot> PlantList = new List<Slot>();
  189. public static List<Star> StarList = new List<Star>();
  190. public static List<ElfType> ElfList = new List<ElfType>();
  191. public static List<Transform> PageList = new List<Transform>();
  192. public static Dictionary<int, FlowerInfo> FlowerInfoDic = new Dictionary<int, FlowerInfo>();
  193. public static TweenMatFloat FlowerCardMatTween;
  194. #endregion
  195. public void Update()
  196. {
  197. if (TutorialManager.NewplayerTutorial || Player.InDressRoom || SFSManager.GardenSmartFox.PlazaRoomController.JoinedPlazaRoom)
  198. {
  199. return;
  200. }
  201. ElfThread();
  202. StarThread();
  203. AwardThread();
  204. }
  205. public static float MinElfTime = 5;
  206. public static float MaxElfTime = 30;
  207. public void ElfThread()
  208. {
  209. if (!MiniLock)
  210. {
  211. return;
  212. }
  213. ElfTimer -= Time.deltaTime;
  214. if (ElfTimer < 0)
  215. {
  216. ElfTimer = Random.Range(MinElfTime, MaxElfTime);
  217. if (ElfList.Count > 0 && PlantList.Count > 0)
  218. {
  219. PlantList.Random()[0].Flower.GetElf(ElfList.Random()[0]);
  220. }
  221. }
  222. }
  223. public static float MinStarTime;
  224. public static float MaxStarTime;
  225. public void StarThread()
  226. {
  227. if (MiniLock && !Manager.MiniLock && !VisitManager.InVisit)
  228. {
  229. StarTimer -= Time.deltaTime;
  230. if (StarTimer < 0)
  231. {
  232. StarTimer = Mathf.Lerp(MinStarTime, MaxStarTime, Random.Range(0f, 1f));
  233. StarList.Add(ResourceManager.GetStar());
  234. }
  235. }
  236. }
  237. public static float MinAwardTime = 5;
  238. public static float MaxAwardTime = 15;
  239. public void AwardThread()
  240. {
  241. if (MiniLock)
  242. {
  243. AwardTimer -= Time.deltaTime;
  244. if (AwardTimer <= 0)
  245. {
  246. AwardTimer = Random.Range(MinAwardTime, MaxAwardTime);
  247. List<Flower> spareList = new List<Flower>();
  248. for (int i = 0; i < PlantList.Count; i++)
  249. {
  250. if (PlantList[i].Flower.Award == false)
  251. {
  252. spareList.Add(PlantList[i].Flower);
  253. }
  254. }
  255. if (spareList.Count > 0)
  256. {
  257. spareList.Random()[0].Award = true;
  258. }
  259. }
  260. }
  261. }
  262. public override void InstantiatePrefabs()
  263. {
  264. ResourceManager.Get(ResourceLabel.Garden, Folder.Scene, true, transform, true, ObjType.Garden).AddScript<Garden>();
  265. for (int i = 0; i < DefaultPage; i++)
  266. {
  267. CreatePage();
  268. }
  269. #region 生成FlowerItem
  270. List<XmlAttributeCollection> attributeList = ConfigManager.GetFlowerConfig();
  271. for (int i = 0; i < attributeList.Count; i++)
  272. {
  273. FlowerInfo flowerInfo = new FlowerInfo(attributeList[i]);
  274. if (flowerInfo.Special)
  275. {
  276. TotalFlowerSpec++;
  277. }
  278. else
  279. {
  280. TotalFlowerRegu++;
  281. }
  282. FlowerInfoDic.Add(flowerInfo.ID_, flowerInfo);
  283. }
  284. #endregion
  285. }
  286. public override void FirstInit()
  287. {
  288. Instance = this;
  289. ElfTimer = Random.Range(MinElfTime, MaxElfTime);
  290. AwardTimer = Random.Range(MinAwardTime, MaxAwardTime);
  291. UnlockSlot();
  292. for (int i = 0; i < ConfigManager.GetIntFormConfig(PlayerConfigLabel.ExtraSlot); i++)
  293. {
  294. UnlockSlot();
  295. }
  296. #region 读花朵存档
  297. List<int> flowerIDList = ConfigManager.GetFlowerList();
  298. for (int i = 0; i < flowerIDList.Count; i++)
  299. {
  300. FlowerInfoDic[flowerIDList[i]].Unlock = true;
  301. }
  302. List<int> flowerAmountList = ConfigManager.GetIntList(' ', PlayerConfigLabel.FlowerAmtList, null);
  303. for (int i = 0; i < flowerAmountList.Count; i++)
  304. {
  305. FlowerInfoDic[flowerIDList[i]].Amount = flowerAmountList[i];
  306. }
  307. List<KV<int, int>> plantList = ConfigManager.GetPlantList();
  308. for (int i = 0; i < plantList.Count; i++)
  309. {
  310. PlantFlower(plantList[i].Key, plantList[i].Value);
  311. }
  312. #endregion
  313. }
  314. public override void RegistReference()
  315. {
  316. RetrieveButton = ResourceManager.Get<Button>(ObjectLabel.H_Btn);
  317. RetrieveButtonLab = ResourceManager.Get<Text>(ObjectLabel.H_BtnLab);
  318. PurchaseButton = ResourceManager.Get<Button>(ObjectLabel.H_Btn1);
  319. PurchaseButtonLab = ResourceManager.Get<Text>(ObjectLabel.H_BtnLab1);
  320. }
  321. public static int DefaultPage = 2;
  322. public static int CriticalSlotAmt = 7;
  323. public static int TotalSlotAmtInOnePage = 9;
  324. public static int LeftTopSlotIndex = 0;
  325. public static int RightTopSlotIndex = 3;
  326. public static int RightDownSlotIndex = 8;
  327. public static int LeftDownSlotIndex = 4;
  328. public static void UnlockSlot()
  329. {
  330. for (int i = 0; i < SlotList.Count; i++)
  331. {
  332. if (SlotList[i].Lock == false)
  333. {
  334. Slot++;
  335. SlotList[i].Lock = true;
  336. SlotList[i].Available = true;
  337. if (Slot% TotalSlotAmtInOnePage == CriticalSlotAmt)
  338. {
  339. if (Slot/ TotalSlotAmtInOnePage + DefaultPage >= Page)
  340. {
  341. CreatePage();
  342. }
  343. }
  344. return;
  345. }
  346. }
  347. }
  348. private static float PageXOffset = 18.9f;
  349. public static void CreatePage()
  350. {
  351. Transform tra = ResourceManager.Get(ResourceLabel.Page, Folder.Scene, false, ResourceManager.Get(GardenLabel.SlotPage), false, ObjType.Page);
  352. float offset = Page*PageXOffset;
  353. tra.SetLX(offset);
  354. Vector3 pos = ResourceManager.Get(GardenLabel.SlotPage).position;
  355. pos.x = -offset;
  356. Garden.PagePos.Add(pos);
  357. for (int i = 0; i < TotalSlotAmtInOnePage; i++)
  358. {
  359. Slot slot = tra.GetChild(i).GetComponent<Slot>();
  360. if (slot == null)
  361. {
  362. slot = tra.GetChild(i).AddScript<Slot>();
  363. }
  364. slot.Index = SlotList.Count;
  365. SlotList.Add(slot);
  366. }
  367. PageList.Add(tra);
  368. }
  369. public static void ShowPlantCard(FlowerInfo flowerInfo, Slot seleSlot = null)
  370. {
  371. ShowFlowerCard(flowerInfo, null, seleSlot);
  372. RetrieveButton.SetActive(false);
  373. PurchaseButton.SetActive(true);
  374. }
  375. public static void ShowRetrieveCard(FlowerInfo flowerInfo, Slot seleSlot = null)
  376. {
  377. ShowFlowerCard(flowerInfo, null, seleSlot);
  378. RetrieveButton.SetActive(true);
  379. PurchaseButton.SetActive(true);
  380. }
  381. public static void ShowUnlockCard(FlowerInfo flowerInfo, Slot seleSlot = null)
  382. {
  383. ShowFlowerCard(flowerInfo, Lib.GrayMat, seleSlot);
  384. RetrieveButton.SetActive(false);
  385. PurchaseButton.SetActive(true);
  386. }
  387. private static void ShowFlowerCard(FlowerInfo flowerInfo, Material material, Slot seleSlot)
  388. {
  389. SetRetrieveBtn(RetrieveButton, RetrieveButtonLab, seleSlot);
  390. SetPurchaseBtn(flowerInfo, PurchaseButton, PurchaseButtonLab);
  391. SeleInfo = flowerInfo;
  392. ResourceManager.Get(ObjectLabel.H_FlowerCard).TweenForCG();
  393. ResourceManager.SetText(ObjectLabel.H_Lab, flowerInfo.Name);
  394. SetPlantStatus(flowerInfo);
  395. Image image = ResourceManager.Get<Image>(ObjectLabel.H_Icon2);
  396. image.material = material;
  397. image.sprite = flowerInfo.Icon;
  398. image.Resize(true, DeltaSize.FlowerCardSpriteX, DeltaSize.FlowerCardSpriteY);
  399. }
  400. private static void SetRetrieveBtn(Button button, Text buttonLab, Slot seleSlot = null)
  401. {
  402. RetrieveButton = button;
  403. buttonLab.text = Language.GetStr(LanguageLabel.UI__H_BtnLab1);
  404. button.image.material = null;
  405. button.onClick.RemoveAllListeners();
  406. button.onClick.AddListener
  407. (
  408. () =>
  409. {
  410. AudioManager.PlayClip(AudioLabel.ClickButton);
  411. RetriveFlower(seleSlot);
  412. }
  413. );
  414. }
  415. private static void SetPurchaseBtn(FlowerInfo flowerInfo, Button button, Text buttonLab)
  416. {
  417. if (flowerInfo.UnlockCur == Current.Free)
  418. {
  419. buttonLab.text = Language.GetStr(LanguageLabel.UI__H_BtnLab2);
  420. button.image.material = Lib.GrayMat;
  421. button.onClick.RemoveAllListeners();
  422. button.onClick.AddListener
  423. (
  424. () =>
  425. {
  426. Bubble.Show(null, Language.GetStr(LanguageLabel.UI__H_BtnLab3));
  427. }
  428. );
  429. }
  430. else
  431. {
  432. buttonLab.text = Auxiliary.ImageParse(flowerInfo.UnlockCur) + flowerInfo.UnlockAmt;
  433. button.image.material = null;
  434. button.onClick.RemoveAllListeners();
  435. button.onClick.AddListener
  436. (
  437. () =>
  438. {
  439. Manager.Pay
  440. (
  441. "",
  442. flowerInfo.UnlockAmt,
  443. flowerInfo.UnlockCur,
  444. () =>
  445. {
  446. flowerInfo.Add();
  447. SetPlantStatus(flowerInfo);
  448. HttpManager.Save();
  449. PlayFlowerCardMatTween();
  450. AudioManager.PlayClip(AudioLabel.GetCurrent);
  451. ResourceManager.Get(ObjectLabel.H_Icon1).FindChild($"{ObjectLabel.H_UIFlashLight}/{ObjectLabel.H_UIParticleSystem}").GetComponent<UIPartical>().Begin();
  452. },
  453. StaticsManager.ItemID.解锁花朵,
  454. StaticsManager.ConsumeModule.Shop,
  455. true,
  456. false,
  457. () =>
  458. {
  459. ResourceManager.Get(ObjectLabel.H_FlowerCard).TweenBacCG();
  460. TweenCG tweenCg = ResourceManager.Get(ObjectLabel.G_Flower).TweenBacCG();
  461. tweenCg.AddEventOnetime
  462. (
  463. EventType.BackwardFinish,
  464. () =>
  465. {
  466. ResourceManager.Get(ObjectLabel.F_Manage0).TweenForVec();
  467. }
  468. );
  469. }
  470. );
  471. }
  472. );
  473. }
  474. }
  475. private static void SetPlantStatus(FlowerInfo flowerInfo)
  476. {
  477. if (flowerInfo.RemainAmount == 0)
  478. {
  479. ResourceManager.Get<Button>(ObjectLabel.H_Icon2).interactable = false;
  480. ResourceManager.SetActive(ObjectLabel.H_AmtLab, false);
  481. ResourceManager.SetActive(ObjectLabel.H_Desc, false);
  482. ResourceManager.SetActive(ObjectLabel.H_Rotate, false);
  483. }
  484. else
  485. {
  486. ResourceManager.SetActive(ObjectLabel.H_Desc, true);
  487. ResourceManager.Get<Button>(ObjectLabel.H_Icon2).interactable = true;
  488. ResourceManager.SetActive(ObjectLabel.H_AmtLab, true);
  489. ResourceManager.SetText(ObjectLabel.H_AmtLab, FlowerInfo.AmountTextPrefix + flowerInfo.RemainAmount);
  490. ResourceManager.SetActive(ObjectLabel.H_Rotate, true);
  491. }
  492. }
  493. private static void SetRetrieveStatus(FlowerInfo flowerInfo, Button button)
  494. {
  495. if (flowerInfo.PlantAmt == 0)
  496. button.SetActive(false);
  497. else
  498. button.SetActive(true);
  499. }
  500. private static void PlayFlowerCardMatTween()
  501. {
  502. if (ResourceManager.Get<Image>(ObjectLabel.H_Icon2).material != Lib.GrayMat)
  503. {
  504. return;
  505. }
  506. Material material = new Material(ResourceManager.Get<Image>(ObjectLabel.H_Icon2).material);
  507. MaterialUnit materialUnit = new MaterialUnit
  508. (
  509. material,
  510. ResourceManager.Get(ObjectLabel.H_Icon2),
  511. new List<string>()
  512. {
  513. MaterialLabel.GrayMatGrayLerp,
  514. }
  515. );
  516. FlowerCardMatTween = materialUnit.CreateTweenMatFloat(1, 0, 1, true, true, Curve.EaseOutQuad, false);
  517. FlowerCardMatTween.OnForwardStart = () =>
  518. {
  519. materialUnit.Transform.GetComponent<Image>().material = materialUnit.Material;
  520. };
  521. FlowerCardMatTween.OnForwardFinish = () =>
  522. {
  523. ResourceManager.Get<Image>(ObjectLabel.H_Icon2).material = null;
  524. };
  525. materialUnit.TweenForMatFloat();
  526. }
  527. public static void RetriveFlower(Slot seleSlot = null)
  528. {
  529. if (seleSlot != null && seleSlot.Flower == null)
  530. seleSlot = null;
  531. if (seleSlot == null)
  532. {
  533. foreach (var slot in PlantList)
  534. {
  535. if (slot.Flower.FlowerInfo == SeleInfo)
  536. {
  537. seleSlot = slot;
  538. break;
  539. }
  540. }
  541. }
  542. seleSlot.Retrieve();
  543. SetPlantStatus(seleSlot.FlowerInfo);
  544. SetRetrieveStatus(seleSlot.FlowerInfo, RetrieveButton);
  545. }
  546. public static void RetriveFlowerAll()
  547. {
  548. for (int i = 0; i < PlantList.Count; i++)
  549. {
  550. PlantList[i--].Retrieve();
  551. }
  552. }
  553. public static void PlantFlower(int id, int index)
  554. {
  555. Slot slot = SlotList[index];
  556. FlowerInfo flowerInfo = FlowerInfoDic[id];
  557. slot.Plant(flowerInfo, false);
  558. }
  559. public static void PlantFlower(FlowerInfo flowerInfo)
  560. {
  561. Slot slot = null;
  562. for (int i = 0; i < SlotList.Count; i++)
  563. {
  564. if (SlotList[i].Available)
  565. {
  566. slot = SlotList[i];
  567. break;
  568. }
  569. }
  570. if (slot == null)
  571. {
  572. Bubble.Show(null, Language.GetStr(LanguageLabel.Common__NoValidSlot));
  573. }
  574. else
  575. {
  576. slot.Plant(flowerInfo, true);
  577. SetPlantStatus(flowerInfo);
  578. SetRetrieveStatus(flowerInfo, RetrieveButton);
  579. AudioManager.PlayClip(AudioLabel.PlantFlower);
  580. }
  581. }
  582. public static void RetrieveAllElf()
  583. {
  584. for (int i = 0; i < PlantList.Count; i++)
  585. {
  586. PlantList[i].Flower.RetrieveElf();
  587. }
  588. }
  589. public static void RetrieveAllStar()
  590. {
  591. for (int i = 0; i < StarList.Count; i++)
  592. {
  593. ResourceManager.Save(StarList[i]);
  594. }
  595. }
  596. }