ManaMiniGame.cs 39 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588
  1. using UnityEngine;
  2. using UnityEngine.UI;
  3. using UnityEngine.Serialization;
  4. using System;
  5. using System.Xml;
  6. using System.Text;
  7. using System.Collections;
  8. using System.Collections.Generic;
  9. using Random = UnityEngine.Random;
  10. public class Award
  11. {
  12. #region 变量
  13. public static int BonusCoin;
  14. public static int BonusDiamond;
  15. public static string Info;
  16. public int Rate;
  17. public int Coin;
  18. public int Score;
  19. public int Diamond;
  20. public bool FlowerFlag;
  21. public bool DiamondFlag;
  22. #region 配置
  23. public static int FlowerID;
  24. public static bool FlowerLock;
  25. public int DiamondMin;
  26. public int DiamondMax;
  27. public string CoinFml;
  28. public string FlowerFml;
  29. public string DiamondFml;
  30. public List<float> Odds = new List<float>();
  31. public List<float> Standard = new List<float>();
  32. #endregion
  33. #endregion
  34. public void GetAward(int score)
  35. {
  36. #region 获得奖励
  37. #region Rate
  38. Score = (int)Mathf.Clamp(score, 1, Mathf.Infinity);
  39. if (Score < Standard[1])
  40. {
  41. Rate = 0;
  42. }
  43. else if (Score < Standard[2])
  44. {
  45. Rate = 1;
  46. }
  47. else
  48. {
  49. Rate = 2;
  50. }
  51. #endregion
  52. #region Reset
  53. FlowerFlag = false;
  54. DiamondFlag = false;
  55. #endregion
  56. StringBuilder sb = new StringBuilder();
  57. #region Coin
  58. Coin = (int)Auxiliary.FmlParse(CoinFml, "s", Score.ToString(), "l", Mathf.Clamp(ManaCenter.Level, 1, 9999).ToString());
  59. Coin = (int)(Coin * (1 + ManaCenter.SkillPlus) + BonusCoin);
  60. Coin = (int) Mathf.Clamp(Coin, 1, Mathf.Infinity);
  61. ManaReso.Get<Text>("Da_CoinLab").text = Coin.ToString();
  62. ManaReso.Get<Text>("Da_CoinLab").Resize(true, false);
  63. ManaReso.Get<ContentSizeFitter>("Da_CoinGroup").enabled = true;
  64. ManaReso.SetActive("Da_CoinLab", true);
  65. ManaCenter.Coin += Coin;
  66. sb.AppendFormat("{0}{1}{2} ", Language.GetStr("UI", "J_Info0"), "<(金币)>", Coin);
  67. #endregion
  68. #region Diamond
  69. float diamondRate = (float)Auxiliary.FmlParse(DiamondFml, "l", Mathf.Clamp(ManaCenter.Level, 1, 1000).ToString());
  70. if (Random.Range(0, 1f) <= diamondRate)
  71. {
  72. DiamondFlag = true;
  73. Diamond = (int)(Mathf.Lerp(DiamondMin, DiamondMax, Random.Range(0, 1f)) + BonusDiamond);
  74. ManaReso.Get<Text>("Da_DiamondLab").text = Diamond.ToString();
  75. ManaReso.Get<Text>("Da_DiamondLab").Resize(true, false);
  76. ManaReso.Get<ContentSizeFitter>("Da_DiamondGroup").enabled = true;
  77. ManaReso.SetActive("Da_DiamondLab", true);
  78. ManaCenter.Diamond += Diamond;
  79. ManaReso.SetActive("Da_Diamond", true);
  80. sb.AppendFormat("{0}{1}{2} ", Language.GetStr("UI", "J_Info0"), "<(钻石)>", Diamond);
  81. }
  82. else
  83. {
  84. if (BonusDiamond > 0)
  85. {
  86. DiamondFlag = true;
  87. Diamond = BonusDiamond;
  88. ManaReso.Get<Text>("Da_DiamondLab").text = Diamond.ToString();
  89. ManaReso.Get<Text>("Da_DiamondLab").Resize(true, false);
  90. ManaReso.Get<ContentSizeFitter>("Da_DiamondGroup").enabled = true;
  91. ManaReso.SetActive("Da_DiamondLab", true);
  92. ManaCenter.Diamond += Diamond;
  93. ManaReso.SetActive("Da_Diamond", true);
  94. sb.AppendFormat("{0}{1}{2} ", Language.GetStr("UI", "J_Info0"), "<(钻石)>", Diamond);
  95. }
  96. }
  97. #endregion
  98. #region Flower
  99. if (ManaTutorial.TutorialA)
  100. {
  101. FlowerFlag = true;
  102. FlowerInfo flowerInfo = ManaGarden.FlowerInfoDic[1];
  103. ManaReso.SetActive("Da_FlowerIcon", true);
  104. ManaReso.Get<Image>("Da_FlowerIcon").sprite = flowerInfo.Icon;
  105. ManaReso.Get<Image>("Da_FlowerIcon").Resize(true, 0.2f, 0.2f);
  106. ManaReso.SetText("Da_FlowerLab", flowerInfo.Name);
  107. sb.AppendFormat("{0}{1}{2}", Language.GetStr("UI", "J_Info0"), "<(花朵)>", flowerInfo.Name);
  108. }
  109. else
  110. {
  111. if (!FlowerLock)
  112. {
  113. FlowerFlag = true;
  114. if (Random.Range(0, 1f) <= Odds[Rate])
  115. {
  116. FlowerInfo flowerInfo = ManaGarden.FlowerInfoDic[FlowerID];
  117. flowerInfo.Unlock = true;
  118. ManaReso.SetActive("Da_Flower", true);
  119. ManaReso.Get<Image>("Da_FlowerIcon").sprite = flowerInfo.Icon;
  120. ManaReso.Get<Image>("Da_FlowerIcon").Resize(true, 0.2f, 0.2f);
  121. ManaReso.SetText("Da_FlowerLab", flowerInfo.Name);
  122. sb.AppendFormat("{0}{1}{2}", Language.GetStr("UI", "J_Info0"), "<(花朵)>", flowerInfo.Name);
  123. }
  124. else
  125. {
  126. ManaReso.SetActive("Da_Flower", false);
  127. ManaReso.SetText("Da_FlowerLab", Language.GetStr("UI", "Da_HigherScore"));
  128. }
  129. }
  130. }
  131. #endregion
  132. Info = sb.ToString();
  133. BonusCoin = 0;
  134. BonusDiamond = 0;
  135. #endregion
  136. ManaReso.SetActive("Da_Info", true);
  137. Auxiliary.Instance.DelayCall
  138. (
  139. () =>
  140. {
  141. ManaReso.Get<Text>("Da_CoinLab").SetLayoutDirty();
  142. ManaReso.Get<Text>("Da_DiamondLab").SetLayoutDirty();
  143. ManaReso.Get<ContentSizeFitter>("Da_CoinGroup").enabled = false;
  144. ManaReso.Get<ContentSizeFitter>("Da_DiamondGroup").enabled = false;
  145. InitializeAnim();
  146. },
  147. 2
  148. );
  149. }
  150. public void InitializeAnim()
  151. {
  152. #region 构造动画
  153. #region Reset
  154. ManaReso.Get("Da_Info").TweenForCG();
  155. ManaReso.SetText("Da_Tit", Language.GetStr("UI", "Da_Tit1"));
  156. ManaReso.SetText("Da_CoinLab", "0");
  157. ManaReso.SetText("Da_DiamondLab", "0");
  158. ManaReso.SetActive("Da_Lab", false);
  159. ManaReso.SetActive("Da_Quit", false);
  160. ManaReso.SetActive("Da_Cancel", false);
  161. ManaReso.SetActive("Da_CoinLab", false);
  162. ManaReso.SetActive("Da_ScoreTit", false);
  163. ManaReso.SetActive("Da_ScoreLab", false);
  164. ManaReso.SetActive("Da_GetAward", false);
  165. ManaReso.SetActive("Da_DiamondLab", false);
  166. ManaReso.SetActive("Da_VGroup", true);
  167. ManaReso.SetActive("Da_HGroup1", false);
  168. ManaReso.SetActive("Da_FlowerGroup", false);
  169. ManaReso.SetActive("Da_DiamondGroup", false);
  170. if (FlowerFlag)
  171. {
  172. ManaReso.SetActive("Da_FlowerGroup", true);
  173. }
  174. if (DiamondFlag)
  175. {
  176. ManaReso.SetActive("Da_DiamondGroup", true);
  177. }
  178. Auxiliary.Instance.DelayCall
  179. (
  180. () =>
  181. {
  182. ManaReso.Get<VerticalLayoutGroup>("Da_VGroup").enabled = false;
  183. ManaReso.SetActive("Da_CoinGroup", false);
  184. ManaReso.SetActive("Da_FlowerGroup", false);
  185. ManaReso.SetActive("Da_DiamondGroup", false);
  186. },
  187. 1
  188. );
  189. float timeCoin = Mathf.Lerp(0, 1.5f, Mathf.Clamp01(Coin / 15f));
  190. float timeScore = Mathf.Lerp(0, 1.5f, Mathf.Clamp01(Score / 50f));
  191. float timeDiamond = Mathf.Lerp(0, 1.5f, Mathf.Clamp01(Diamond / 15f));
  192. float time = Mathf.Max(timeCoin, timeDiamond);
  193. ManaReso.Get("Da_CoinLab").CreateTweenNumber(0, Coin, time, false, true, Curve.EaseOutQuad);
  194. ManaReso.Get("Da_ScoreLab").CreateTweenNumber(0, Score, timeScore, false, true, Curve.EaseOutQuad);
  195. ManaReso.Get("Da_DiamondLab").CreateTweenNumber(0, Diamond, time, false, true, Curve.EaseOutQuad);
  196. #endregion
  197. #region 花
  198. TweenRoot tween;
  199. if (FlowerFlag)
  200. {
  201. tween = ManaReso.Get("Da_CoinLab").GetTweenNumber();
  202. tween.AddEventOnetime
  203. (
  204. EventType.ForwardFinish,
  205. () =>
  206. {
  207. ManaReso.Get("Da_FlowerGroup").TweenReForScale();
  208. }
  209. );
  210. }
  211. #endregion
  212. #region 按钮
  213. if (FlowerFlag)
  214. {
  215. tween = ManaReso.Get("Da_FlowerGroup").GetTweenScale();
  216. tween.AddEventOnetime
  217. (
  218. EventType.ForwardFinish,
  219. () =>
  220. {
  221. ManaReso.Get("Da_GetAward").TweenReForCG();
  222. }
  223. );
  224. }
  225. else
  226. {
  227. tween = ManaReso.Get("Da_CoinLab").GetTweenNumber();
  228. tween.AddEventOnetime
  229. (
  230. EventType.ForwardFinish,
  231. () =>
  232. {
  233. ManaReso.Get("Da_GetAward").TweenReForCG();
  234. }
  235. );
  236. }
  237. if (ManaTutorial.TutorialA)
  238. {
  239. tween = ManaReso.Get("Da_GetAward").GetTweenCG();
  240. tween.AddEventOnetime
  241. (
  242. EventType.ForwardFinish,
  243. () =>
  244. {
  245. Tutorial.HightScreen(ManaReso.Get("Da_Arrow0"), ManaReso.Get("Da_Arrow1"), ManaReso.Get("Da_GetAward"));
  246. }
  247. );
  248. }
  249. ManaReso.AddButtonEventOnetime
  250. (
  251. "Da_GetAward",
  252. () =>
  253. {
  254. ManaReso.Get("Da_VGroup").GetComponent<VerticalLayoutGroup>().enabled = true;
  255. }
  256. );
  257. #endregion
  258. #region 得分
  259. if (Rate == 0)
  260. {
  261. tween = ManaReso.Get("Da_Star1").GetTweenScale();
  262. }
  263. else if (Rate == 1)
  264. {
  265. tween = ManaReso.Get("Da_Star2").GetTweenScale();
  266. }
  267. else if (Rate == 2)
  268. {
  269. tween = ManaReso.Get("Da_Star3").GetTweenScale();
  270. }
  271. tween.AddEventOnetime
  272. (
  273. EventType.ForwardFinish,
  274. () =>
  275. {
  276. ManaReso.Get("Da_ScoreTit").TweenReForFont();
  277. }
  278. );
  279. tween = ManaReso.Get("Da_ScoreTit").GetTweenFont();
  280. tween.InOrigin = true;
  281. tween.AddEventOnetime
  282. (
  283. EventType.ForwardFinish,
  284. () =>
  285. {
  286. ManaReso.Get("Da_ScoreLab").TweenReForNumber();
  287. }
  288. );
  289. #endregion
  290. #region 五角星
  291. tween = ManaReso.Get("Da_Star3").GetTweenScale();
  292. tween.InOrigin = true;
  293. tween = ManaReso.Get("Da_Star2").GetTweenScale();
  294. tween.InOrigin = true;
  295. tween = ManaReso.Get("Da_Star1").GetTweenScale();
  296. tween.InOrigin = true;
  297. tween = ManaReso.Get("Da_Info").GetTweenCG();
  298. tween.AddEventOnetime
  299. (
  300. EventType.ForwardFinish,
  301. () =>
  302. {
  303. ManaReso.Get("Da_Star1").TweenReForScale();
  304. ManaReso.SetActive("Da_HGroup1", true);
  305. }
  306. );
  307. if (Rate == 0)
  308. {
  309. ManaReso.SetActive("Da_Star2", false);
  310. ManaReso.SetActive("Da_Star3", false);
  311. }
  312. else if (Rate == 1)
  313. {
  314. ManaReso.SetActive("Da_Star2", true);
  315. ManaReso.SetActive("Da_Star3", false);
  316. tween = ManaReso.Get("Da_Star1").GetTweenScale();
  317. tween.AddEventOnetime
  318. (
  319. EventType.ForwardFinish,
  320. () =>
  321. {
  322. ManaReso.Get("Da_Star2").TweenReForScale();
  323. }
  324. );
  325. }
  326. else if (Rate == 2)
  327. {
  328. ManaReso.SetActive("Da_Star2", true);
  329. ManaReso.SetActive("Da_Star3", true);
  330. tween = ManaReso.Get("Da_Star1").GetTweenScale();
  331. tween.AddEventOnetime
  332. (
  333. EventType.ForwardFinish,
  334. () =>
  335. {
  336. ManaReso.Get("Da_Star2").TweenReForScale();
  337. }
  338. );
  339. tween = ManaReso.Get("Da_Star2").GetTweenScale();
  340. tween.AddEventOnetime
  341. (
  342. EventType.ForwardFinish,
  343. () =>
  344. {
  345. ManaReso.Get("Da_Star3").TweenReForScale();
  346. }
  347. );
  348. }
  349. #endregion
  350. #region 金币钻石
  351. tween = ManaReso.Get("Da_ScoreLab").GetTweenNumber();
  352. tween.AddEventOnetime
  353. (
  354. EventType.ForwardFinish,
  355. () =>
  356. {
  357. ManaReso.Get("Da_CoinGroup").TweenReForScale();
  358. if (DiamondFlag)
  359. {
  360. ManaReso.Get("Da_DiamondGroup").TweenReForScale();
  361. }
  362. }
  363. );
  364. tween = ManaReso.Get("Da_CoinGroup").GetTweenScale();
  365. tween.AddEventOnetime
  366. (
  367. EventType.ForwardFinish,
  368. () =>
  369. {
  370. ManaReso.Get("Da_CoinLab").TweenReForNumber();
  371. }
  372. );
  373. if (DiamondFlag)
  374. {
  375. tween = ManaReso.Get("Da_DiamondGroup").GetTweenScale();
  376. tween.AddEventOnetime
  377. (
  378. EventType.ForwardFinish,
  379. () =>
  380. {
  381. ManaReso.Get("Da_DiamondLab").TweenReForNumber();
  382. }
  383. );
  384. }
  385. #endregion
  386. #endregion
  387. }
  388. public Award(XmlAttributeCollection attribute)
  389. {
  390. Flower.CoinFml = attribute[8].Value;
  391. DropGold.CoinFml = attribute[7].Value;
  392. Star.CD = float.Parse(attribute[9].Value);
  393. Star.Time = float.Parse(attribute[11].Value);
  394. string[] strings = attribute[10].Value.Split(',');
  395. ManaGarden.MinStarTime = float.Parse(strings[0]);
  396. ManaGarden.MaxStarTime = float.Parse(strings[1]);
  397. ManaGarden.StarTimer = Mathf.Lerp(ManaGarden.MinStarTime, ManaGarden.MaxStarTime, Random.Range(0f, 1f));
  398. CoinFml = attribute[1].Value;
  399. FlowerFml = attribute[4].Value;
  400. DiamondFml = attribute[3].Value;
  401. strings = attribute[2].Value.Split(',');
  402. DiamondMin = int.Parse(strings[0]);
  403. DiamondMax = int.Parse(strings[1]);
  404. strings = attribute[5].Value.Split(',');
  405. Odds = new List<float>()
  406. {
  407. float.Parse(strings[0]),
  408. float.Parse(strings[1]),
  409. float.Parse(strings[2]),
  410. };
  411. strings = attribute[6].Value.Split(',');
  412. Standard = new List<float>()
  413. {
  414. float.Parse(strings[0]),
  415. float.Parse(strings[1]),
  416. float.Parse(strings[2]),
  417. };
  418. }
  419. }
  420. public class ManaMiniGame : Regist
  421. {
  422. #region 变量
  423. public static int Score
  424. {
  425. get { return Score_; }
  426. set
  427. {
  428. Score_ = value;
  429. ManaReso.SetText("D_ScoreLab", ScoreLab + Score_);
  430. }
  431. }
  432. public static bool Game
  433. {
  434. get { return Game_; }
  435. set
  436. {
  437. Game_ = value;
  438. if (Game_)
  439. {
  440. ManaReso.SetText("D_StatusLab", Language.GetStr("UI", "D_StatusLab1"));
  441. }
  442. else
  443. {
  444. ManaReso.SetText("D_StatusLab", Language.GetStr("UI", "D_StatusLab0"));
  445. }
  446. }
  447. }
  448. public static bool Pause
  449. {
  450. get { return Pause_; }
  451. set
  452. {
  453. Pause_ = value;
  454. if (Game)
  455. {
  456. if (Pause_)
  457. {
  458. ManaReso.SetText("D_StatusLab", Language.GetStr("UI", "D_StatusLab2"));
  459. }
  460. else
  461. {
  462. ManaReso.SetText("D_StatusLab", Language.GetStr("UI", "D_StatusLab1"));
  463. }
  464. }
  465. else if (Prepare)
  466. {
  467. if (Pause_)
  468. {
  469. PrepareLab.GetStreamScale().Pause();
  470. }
  471. else
  472. {
  473. PrepareLab.GetStreamScale().Resume();
  474. }
  475. }
  476. }
  477. }
  478. public static bool Panalty
  479. {
  480. get { return Panalty_; }
  481. set
  482. {
  483. Panalty_ = value;
  484. if (Game)
  485. {
  486. if (Panalty_)
  487. {
  488. ManaReso.SetText("D_StatusLab", Language.GetStr("UI", "D_StatusLab3"));
  489. }
  490. else
  491. {
  492. ManaReso.SetText("D_StatusLab", Language.GetStr("UI", "D_StatusLab1"));
  493. }
  494. }
  495. }
  496. }
  497. public static float GameTimer
  498. {
  499. get { return GameTimer_; }
  500. set
  501. {
  502. GameTimer_ = value;
  503. TimerLab.text = (GameTime-GameTimer_).ToString("0.0");
  504. TimerBk.fillAmount = GameTimer_/GameTime;
  505. TimerBk.material.SetFloat("_Fill", TimerBk.fillAmount);
  506. }
  507. }
  508. private static int Score_;
  509. private static bool Game_;
  510. private static bool Pause_;
  511. private static bool Panalty_;
  512. private static float GameTimer_;
  513. public static Text TimerLab;
  514. public static Text PrepareLab;
  515. public static Image TimerBk;
  516. public static Award Award;
  517. public static Transform D_Grid;
  518. public static Transform D_Timer;
  519. public static Transform D_Begin;
  520. public static Transform D_Status1;
  521. public static Transform D_Status2;
  522. public static Transform D_Operate1;
  523. public static Transform D_Operate2;
  524. public static List<int> IndexList = new List<int>();
  525. public static List<Drop> DropList = new List<Drop>();
  526. public static List<Flower> OpList = new List<Flower>();
  527. public static List<Flower> IdleList = new List<Flower>();
  528. public static List<Flower> FadeList = new List<Flower>();
  529. public static Dictionary<int, Flower> FlowerDic = new Dictionary<int, Flower>();
  530. public static int MiniGameIndex;
  531. public static string ScoreLab;
  532. public static bool GameA;
  533. public static bool GameB;
  534. public static bool Prepare;
  535. public static bool FlowerLock;
  536. public static bool TutorialLock = true;
  537. public static bool DropDiamond;
  538. public static float OpTimer;
  539. public static float FadeTimer;
  540. public static float GoldTimer;
  541. public static float PanaltyTimer;
  542. public static float PrepareTimer;
  543. public static float DiamondTimer;
  544. public static float OpTime = 1.5f;
  545. public static float FadeTime = 2f;
  546. public static float GameTime = 45f;
  547. public static float PanaltyTime = 1f;
  548. public static float NewOpTime;
  549. public static float NewFadeTime;
  550. #endregion
  551. private void FixedUpdate()
  552. {
  553. if (Pause)
  554. {
  555. return;
  556. }
  557. if (Game)
  558. {
  559. GameThreadA();
  560. GameThreadB();
  561. }
  562. if (Prepare)
  563. {
  564. PrepareThread();
  565. }
  566. }
  567. private void GameThreadA()
  568. {
  569. if (GameB)
  570. {
  571. return;
  572. }
  573. GameTimer += Time.fixedDeltaTime;
  574. if (GameTimer >= GameTime)
  575. {
  576. GameOver();
  577. return;
  578. }
  579. if (Panalty)
  580. {
  581. PanaltyTimer -= Time.fixedDeltaTime;
  582. if (PanaltyTimer <= 0)
  583. {
  584. Panalty = false;
  585. }
  586. }
  587. if (IdleList.Count > 0)
  588. {
  589. OpTimer -= Time.fixedDeltaTime;
  590. if (OpTimer <= 0)
  591. {
  592. NewOpTime -= NewOpTime * 0.03f;
  593. OpTimer = NewOpTime;
  594. CreateOperate();
  595. }
  596. }
  597. BonusThread();
  598. }
  599. private void GameThreadB()
  600. {
  601. if (GameA)
  602. {
  603. return;
  604. }
  605. GameTimer += Time.fixedDeltaTime;
  606. if (GameTimer >= GameTime)
  607. {
  608. GameOver();
  609. return;
  610. }
  611. if (Panalty)
  612. {
  613. PanaltyTimer -= Time.fixedDeltaTime;
  614. if (PanaltyTimer <= 0)
  615. {
  616. Panalty = false;
  617. }
  618. }
  619. if (FadeList.Count < 6)
  620. {
  621. FadeTimer -= Time.fixedDeltaTime;
  622. if (FadeTimer <= 0)
  623. {
  624. FadeTimer = NewFadeTime;
  625. Fade();
  626. }
  627. }
  628. BonusThread();
  629. }
  630. private void BonusThread()
  631. {
  632. GoldTimer -= Time.fixedDeltaTime;
  633. if (GoldTimer < 0)
  634. {
  635. GoldTimer = Random.Range(3f, 6f);
  636. DropList.Add(ManaReso.GetDrop(ObjType.DropGold));
  637. }
  638. if (DropDiamond)
  639. {
  640. DiamondTimer -= Time.fixedDeltaTime;
  641. if (DiamondTimer < 0)
  642. {
  643. DropDiamond = false;
  644. DropList.Add(ManaReso.GetDrop(ObjType.DropDiamond));
  645. }
  646. }
  647. }
  648. private void PrepareThread()
  649. {
  650. PrepareTimer -= Time.fixedDeltaTime;
  651. if (PrepareTimer <= 0)
  652. {
  653. Prepare = false;
  654. GameBegin();
  655. }
  656. }
  657. public override void RegistValueA()
  658. {
  659. Award = new Award(ManaData.GetAwardConfig());
  660. MiniGameIndex = ManaData.GetPlayerInt("MiniGameIndex");
  661. }
  662. public override void RegistReference()
  663. {
  664. D_Grid = ManaReso.Get("D_Grid");
  665. D_Begin = ManaReso.Get("D_Begin");
  666. D_Timer = ManaReso.Get("D_Timer");
  667. D_Status1 = ManaReso.Get("D_Status1");
  668. D_Status2 = ManaReso.Get("D_Status2");
  669. D_Operate1 = ManaReso.Get("D_Operate1");
  670. D_Operate2 = ManaReso.Get("D_Operate2");
  671. TimerLab = ManaReso.Get<Text>("D_TimerLab");
  672. PrepareLab = ManaReso.Get<Text>("D_PrepareLab");
  673. TimerBk = ManaReso.Get<Image>("D_TimerIcon");
  674. }
  675. public static void Operate(int index, int slotIndex)
  676. {
  677. if (Panalty || !FadeList.Valid())
  678. {
  679. return;
  680. }
  681. if (IndexList.Count == 0)
  682. {
  683. return;
  684. }
  685. if (slotIndex == IndexList[0])
  686. {
  687. int uiIndex = IndexMap(IndexList[0]);
  688. ManaReso.Get<Image>("D_FlowerBtn" + uiIndex).material = Shortcut.GrayMat;
  689. ManaReso.Get<Button>("D_FlowerBtn" + uiIndex).interactable = false;
  690. ManaReso.Get<Image>("D_FlowerIcon" + uiIndex).material = Shortcut.GrayMat;
  691. ManaReso.SetActive("D_FlowerTick" + uiIndex, true);
  692. IndexList.RemoveAt(0);
  693. Flower flower = FlowerDic[slotIndex];
  694. ManaReso.GetHudText("+30", Color.white, 90, flower.ChildDic["ScorePosTra"], ManaReso.Get("D_HudParent"), true);
  695. Score += 30;
  696. flower.PlayParticle();
  697. TweenRoot tween = flower.FlowerIcon.TweenBacSr();
  698. ManaAudio.PlayClip(Clip.BtnClip);
  699. if (IndexList.Count == 0)
  700. {
  701. tween.AddEventOnetime
  702. (
  703. EventType.BackwardFinish,
  704. () =>
  705. {
  706. RoundEnd();
  707. RoundReset();
  708. RoundBegin();
  709. }
  710. );
  711. }
  712. }
  713. else
  714. {
  715. Panalty = true;
  716. PanaltyTimer = PanaltyTime;
  717. //ManaReso.Get("D_FlowerBtn" + uiIndex).TweenForGra();
  718. ManaReso.Get("D_FlowerIcon" + index).TweenForGra();
  719. ManaReso.Get("D_FlowerBtn" + index).Shake(0.5f, 3, new Vector3(20f, 0, 0), Curve.EaseOutQuad);
  720. ManaAudio.PlayClip(Clip.ErrorClip);
  721. }
  722. }
  723. public static void Operate(OpType opType)
  724. {
  725. if (Panalty || !OpList.Valid())
  726. {
  727. return;
  728. }
  729. if (OpList[0].Operate(opType))
  730. {
  731. IdleList.Add(OpList[0]);
  732. OpList.Remove(OpList[0]);
  733. if (OpList.Count >= 2)
  734. {
  735. OpList[0].SetFirstOp();
  736. OpList[1].SetSecondOp();
  737. }
  738. else if (OpList.Count >= 1)
  739. {
  740. OpList[0].SetFirstOp();
  741. }
  742. }
  743. else
  744. {
  745. Panalty = true;
  746. PanaltyTimer = PanaltyTime;
  747. }
  748. }
  749. public static void ResetOprerate()
  750. {
  751. ManaReso.Get<Image>("D_FlowerBtn1").material = null;
  752. ManaReso.Get<Image>("D_FlowerBtn2").material = null;
  753. ManaReso.Get<Image>("D_FlowerBtn3").material = null;
  754. ManaReso.Get<Image>("D_FlowerBtn4").material = null;
  755. ManaReso.Get<Image>("D_FlowerBtn5").material = null;
  756. ManaReso.Get<Image>("D_FlowerBtn6").material = null;
  757. ManaReso.Get<Button>("D_FlowerBtn1").interactable = true;
  758. ManaReso.Get<Button>("D_FlowerBtn2").interactable = true;
  759. ManaReso.Get<Button>("D_FlowerBtn3").interactable = true;
  760. ManaReso.Get<Button>("D_FlowerBtn4").interactable = true;
  761. ManaReso.Get<Button>("D_FlowerBtn5").interactable = true;
  762. ManaReso.Get<Button>("D_FlowerBtn6").interactable = true;
  763. ManaReso.Get<Image>("D_FlowerIcon1").material = null;
  764. ManaReso.Get<Image>("D_FlowerIcon2").material = null;
  765. ManaReso.Get<Image>("D_FlowerIcon3").material = null;
  766. ManaReso.Get<Image>("D_FlowerIcon4").material = null;
  767. ManaReso.Get<Image>("D_FlowerIcon5").material = null;
  768. ManaReso.Get<Image>("D_FlowerIcon6").material = null;
  769. ManaReso.SetActive("D_FlowerTick1", false);
  770. ManaReso.SetActive("D_FlowerTick2", false);
  771. ManaReso.SetActive("D_FlowerTick3", false);
  772. ManaReso.SetActive("D_FlowerTick4", false);
  773. ManaReso.SetActive("D_FlowerTick5", false);
  774. ManaReso.SetActive("D_FlowerTick6", false);
  775. }
  776. public static void CreateOperate()
  777. {
  778. ManaAudio.PlayClip(Clip.BubbleClip);
  779. if (ManaTutorial.TutorialA && TutorialLock)
  780. {
  781. Pause = true;
  782. TutorialLock = false;
  783. Flower flower = IdleList[4];
  784. flower.CreateOp(OpList.Count, OpType.Water);
  785. OpList.Add(flower);
  786. IdleList.Remove(flower);
  787. Tutorial.HightScreen(ManaReso.Get("D_WaterArrow0"), ManaReso.Get("D_WaterArrow1"), ManaReso.Get("D_Water1"));
  788. Tutorial.SetArea(OpList[0].OperateIcon.transform, 0.1f, 0.125f);
  789. ManaReso.AddButtonEventOnetime
  790. (
  791. "D_Water2",
  792. () =>
  793. {
  794. Pause = false;
  795. Tutorial.HightDisable();
  796. }
  797. );
  798. }
  799. else
  800. {
  801. Flower flower = IdleList[Random.Range(0, IdleList.Count)];
  802. flower.CreateOp(OpList.Count);
  803. OpList.Add(flower);
  804. IdleList.Remove(flower);
  805. }
  806. }
  807. public static void Fade()
  808. {
  809. for (int i = 0; i < IndexList.Count; i++)
  810. {
  811. Flower flower = FlowerDic[IndexList[i]];
  812. if (FadeList.UniqueAdd(flower))
  813. {
  814. IdleList.Remove(flower);
  815. flower.PlayParticle();
  816. flower.FlowerIcon.TweenForSr();
  817. if (FadeList.Count == 6)
  818. {
  819. RoundBegin();
  820. }
  821. break;
  822. }
  823. }
  824. }
  825. public static void InitializeMode()
  826. {
  827. GameA = false;
  828. GameB = false;
  829. D_Operate1.SetActive(false);
  830. D_Operate2.SetActive(false);
  831. if (ManaCenter.Level >= 18)
  832. {
  833. if (ManaTutorial.TutorialB)
  834. {
  835. GameB = true;
  836. }
  837. else
  838. {
  839. if (Random.Range(0f, 1f) <= 0.5f)
  840. {
  841. GameB = true;
  842. }
  843. else
  844. {
  845. GameA = true;
  846. }
  847. }
  848. }
  849. else
  850. {
  851. GameA = true;
  852. }
  853. }
  854. public static void InitializeAward()
  855. {
  856. float flowerRate = (float)Auxiliary.FmlParse(Award.FlowerFml, "l", ManaCenter.Level.ToString(), "f", ManaGarden.MyFlower.ToString());
  857. if (Random.Range(0, 1f) <= flowerRate)
  858. {
  859. if (ManaGarden.MyFlower < ManaGarden.TotalFlower)
  860. {
  861. foreach (var kv in ManaGarden.FlowerInfoDic)
  862. {
  863. if (kv.Value.Unlock == false)
  864. {
  865. Award.FlowerID = kv.Value.ID_;
  866. Award.FlowerLock = false;
  867. break;
  868. }
  869. }
  870. }
  871. else
  872. {
  873. Award.FlowerLock = true;
  874. }
  875. }
  876. else
  877. {
  878. Award.FlowerLock = true;
  879. }
  880. }
  881. public static void GameEnd()
  882. {
  883. PrepareLab.GetStreamScale().InOrigin = true;
  884. if (Game)
  885. {
  886. ManaCenter.MiniLock = false;
  887. ManaCenter.MiniTimer = Mathf.Lerp(180, 300, Random.Range(0, 1f));
  888. }
  889. ManaReso.Get("C_MiniGame").TweenForCG();
  890. if (ManaCenter.MiniTimer > 0)
  891. {
  892. ManaReso.Get("C_MiniGame").TweenForRect();
  893. }
  894. Score = 0;
  895. Pause = false;
  896. Game = false;
  897. Panalty = false;
  898. Prepare = false;
  899. GameTimer = GameTime;
  900. for (int i = 0; i < OpList.Count; i++)
  901. {
  902. OpList[i].GameOver();
  903. }
  904. for (int i = 0; i < IdleList.Count; i++)
  905. {
  906. IdleList[i].GameOver();
  907. }
  908. for (int i = 0; i < DropList.Count; i++)
  909. {
  910. DropList[i].Retrieve();
  911. DropList.RemoveAt(i--);
  912. }
  913. }
  914. public static void GameOver()
  915. {
  916. ManaAudio.PlayClip(Clip.MiniEndClip);
  917. Award.GetAward(Score);
  918. ManaCenter.MiniGameAmt++;
  919. FlowerLock = false;
  920. GameEnd();
  921. }
  922. public static void GameEnter()
  923. {
  924. if (ManaTutorial.TutorialA)
  925. {
  926. Award.FlowerID = 1;
  927. Award.FlowerLock = true;
  928. InitializeMode();
  929. }
  930. else
  931. {
  932. if (!FlowerLock)
  933. {
  934. InitializeMode();
  935. InitializeAward();
  936. FlowerLock = true;
  937. }
  938. }
  939. if (ManaTutorial.TutorialB)
  940. {
  941. InitializeMode();
  942. }
  943. if (GameA)
  944. {
  945. GameEnterA();
  946. }
  947. if (GameB)
  948. {
  949. GameEnterB();
  950. }
  951. ScoreLab = Language.GetStr("UI", "D_ScoreLab");
  952. TimerBk.fillAmount = 0;
  953. TimerLab.text = GameTime.ToString("0");
  954. ManaReso.Get("C_MiniGame").TweenBacCG();
  955. }
  956. public static void GameEnterA()
  957. {
  958. D_Operate1.SetActive(true);
  959. D_Timer.SetParent(D_Status1);
  960. D_Grid.SetParent(D_Status1);
  961. D_Begin.SetParent(D_Operate1);
  962. PrepareLab.SetParent(ManaReso.Get("D_PrepareLayout1"));
  963. ManaReso.SetActive("D_Rip1", false);
  964. ManaReso.SetActive("D_Water1", false);
  965. ManaReso.SetActive("D_Fertilize1", false);
  966. ManaReso.SetActive("D_Begin", true);
  967. ManaReso.SetActive("D_DescA", true);
  968. if (Award.FlowerLock)
  969. {
  970. for (int i = 1; i < 10; i++)
  971. {
  972. while (true)
  973. {
  974. FlowerInfo flowerInfo = ManaGarden.FlowerInfoDic.Random();
  975. if (flowerInfo.Unlock)
  976. {
  977. IdleList.Add(ManaReso.GetFlower(flowerInfo, ManaReso.Get("SlotMini" + i)));
  978. break;
  979. }
  980. }
  981. }
  982. }
  983. else
  984. {
  985. List<int> idList = new List<int>();
  986. idList = new List<int>() {1, 2, 3, 4, 5, 6, 7, 8, 9};
  987. int special = idList.Random(true);
  988. Flower flower = ManaReso.GetFlower(ManaGarden.FlowerInfoDic[Award.FlowerID], ManaReso.Get("SlotMini" + special));
  989. IdleList.Add(flower);
  990. for (int i = 0; i < idList.Count; i++)
  991. {
  992. while (true)
  993. {
  994. FlowerInfo flowerInfo = ManaGarden.FlowerInfoDic.Random();
  995. if (flowerInfo.Unlock)
  996. {
  997. flower = ManaReso.GetFlower(flowerInfo, ManaReso.Get("SlotMini" + idList[i]));
  998. IdleList.Add(flower);
  999. break;
  1000. }
  1001. }
  1002. }
  1003. }
  1004. }
  1005. public static void GameEnterB()
  1006. {
  1007. D_Operate2.SetActive(true);
  1008. D_Timer.SetParent(D_Status2);
  1009. D_Grid.SetParent(D_Status2);
  1010. D_Begin.SetParent(D_Operate2);
  1011. PrepareLab.SetParent(ManaReso.Get("D_PrepareLayout2"));
  1012. ResetOprerate();
  1013. ManaReso.Get("D_Mask").TweenBacGra();
  1014. ManaReso.SetActive("D_FlowerBtn1", false);
  1015. ManaReso.SetActive("D_FlowerBtn2", false);
  1016. ManaReso.SetActive("D_FlowerBtn3", false);
  1017. ManaReso.SetActive("D_FlowerBtn4", false);
  1018. ManaReso.SetActive("D_FlowerBtn5", false);
  1019. ManaReso.SetActive("D_FlowerBtn6", false);
  1020. ManaReso.SetActive("D_Begin", true);
  1021. ManaReso.SetActive("D_DescB", true);
  1022. List<int> idList = new List<int>() {1, 2, 4, 5, 7, 8};
  1023. FlowerDic = new Dictionary<int, Flower>();
  1024. Flower flower;
  1025. if (Award.FlowerLock)
  1026. {
  1027. for (int i = 0; i < idList.Count; i++)
  1028. {
  1029. while (true)
  1030. {
  1031. FlowerInfo flowerInfo = ManaGarden.FlowerInfoDic.Random();
  1032. if (flowerInfo.Unlock)
  1033. {
  1034. flower = ManaReso.GetFlower(flowerInfo, ManaReso.Get("SlotMini" + idList[i]));
  1035. IdleList.Add(flower);
  1036. FlowerDic.Add(idList[i], flower);
  1037. break;
  1038. }
  1039. }
  1040. }
  1041. }
  1042. else
  1043. {
  1044. int special = idList.Random(true);
  1045. flower = ManaReso.GetFlower(ManaGarden.FlowerInfoDic[Award.FlowerID], ManaReso.Get("SlotMini" + special));
  1046. IdleList.Add(flower);
  1047. FlowerDic.Add(special, flower);
  1048. for (int i = 0; i < idList.Count; i++)
  1049. {
  1050. while (true)
  1051. {
  1052. FlowerInfo flowerInfo = ManaGarden.FlowerInfoDic.Random();
  1053. if (flowerInfo.Unlock)
  1054. {
  1055. flower = ManaReso.GetFlower(flowerInfo, ManaReso.Get("SlotMini" + idList[i]));
  1056. IdleList.Add(flower);
  1057. FlowerDic.Add(idList[i], flower);
  1058. break;
  1059. }
  1060. }
  1061. }
  1062. }
  1063. for (int i = 0; i < IdleList.Count; i++)
  1064. {
  1065. IdleList[i].FlowerIcon.CreateTweenSr(1, 0, 0.25f, true, false, Curve.EaseOutQuad, false, true);
  1066. }
  1067. }
  1068. public static void GameBegin()
  1069. {
  1070. Game = true;
  1071. MiniGameIndex++;
  1072. Score = 0;
  1073. OpTimer = OpTime;
  1074. FadeTimer = FadeTime;
  1075. GoldTimer = Random.Range(3f, 6f);
  1076. GameTimer = 0;
  1077. NewOpTime = OpTime;
  1078. NewFadeTime = FadeTime;
  1079. DiamondTimer = Random.Range(0f, GameTime - 5);
  1080. if (GameA)
  1081. {
  1082. for (int i = 0; i < IdleList.Count; i++)
  1083. {
  1084. IdleList[i].GameBegin();
  1085. }
  1086. }
  1087. if (GameB)
  1088. {
  1089. RoundReset();
  1090. }
  1091. if (Random.Range(5, 9) <= MiniGameIndex)
  1092. {
  1093. MiniGameIndex = 0;
  1094. DropDiamond = true;
  1095. }
  1096. else
  1097. {
  1098. if (Random.Range(0, 1f) <= 0.01f)
  1099. {
  1100. DropDiamond = true;
  1101. }
  1102. else
  1103. {
  1104. DropDiamond = false;
  1105. }
  1106. }
  1107. }
  1108. public static void GamePrepare()
  1109. {
  1110. Prepare = true;
  1111. PrepareTimer = 3;
  1112. ManaReso.Get("D_Begin").SetActive(false);
  1113. ManaReso.Get("D_DescA").SetActive(false);
  1114. ManaReso.Get("D_DescB").SetActive(false);
  1115. if (GameA)
  1116. {
  1117. ManaReso.Get("D_Rip1").SetActive(true);
  1118. ManaReso.Get("D_Water1").SetActive(true);
  1119. ManaReso.Get("D_Fertilize1").SetActive(true);
  1120. }
  1121. if (GameB)
  1122. {
  1123. ManaReso.Get("D_Mask").TweenForGra();
  1124. ManaReso.SetActive("D_FlowerBtn1", true);
  1125. ManaReso.SetActive("D_FlowerBtn2", true);
  1126. ManaReso.SetActive("D_FlowerBtn3", true);
  1127. ManaReso.SetActive("D_FlowerBtn4", true);
  1128. ManaReso.SetActive("D_FlowerBtn5", true);
  1129. ManaReso.SetActive("D_FlowerBtn6", true);
  1130. ManaReso.SetSprite("D_FlowerIcon1", FlowerDic[1].FlowerInfo.Icon).Resize(true, 1f, 1f);
  1131. ManaReso.SetSprite("D_FlowerIcon2", FlowerDic[2].FlowerInfo.Icon).Resize(true, 1f, 1f);
  1132. ManaReso.SetSprite("D_FlowerIcon3", FlowerDic[4].FlowerInfo.Icon).Resize(true, 1f, 1f);
  1133. ManaReso.SetSprite("D_FlowerIcon4", FlowerDic[5].FlowerInfo.Icon).Resize(true, 1f, 1f);
  1134. ManaReso.SetSprite("D_FlowerIcon5", FlowerDic[7].FlowerInfo.Icon).Resize(true, 1f, 1f);
  1135. ManaReso.SetSprite("D_FlowerIcon6", FlowerDic[8].FlowerInfo.Icon).Resize(true, 1f, 1f);
  1136. }
  1137. PrepareLab.StreamForScale();
  1138. }
  1139. public static void RoundEnd()
  1140. {
  1141. ManaReso.Get("D_Mask").TweenForGra();
  1142. }
  1143. public static void RoundReset()
  1144. {
  1145. for (int i = 0; i < FadeList.Count; i++)
  1146. {
  1147. IdleList.Add(FadeList[i]);
  1148. }
  1149. NewFadeTime -= NewFadeTime * 0.3f;
  1150. FadeTimer = NewFadeTime;
  1151. FadeList = new List<Flower>();
  1152. IndexList = new List<int>();
  1153. List<int> randomList = new List<int>() { 1, 2, 4, 5, 7, 8 };
  1154. for (int i = 0; i < randomList.Count; i++)
  1155. {
  1156. IndexList.Add(randomList.Random(true));
  1157. i--;
  1158. }
  1159. ResetOprerate();
  1160. }
  1161. public static void RoundBegin()
  1162. {
  1163. ManaReso.Get("D_Mask").TweenBacGra();
  1164. if (ManaTutorial.TutorialB)
  1165. {
  1166. ManaTutorial.EnterB1();
  1167. }
  1168. }
  1169. public static int IndexMap(int slotIndex)
  1170. {
  1171. if (slotIndex == 1)
  1172. {
  1173. return 1;
  1174. }
  1175. else if (slotIndex == 2)
  1176. {
  1177. return 2;
  1178. }
  1179. else if (slotIndex == 4)
  1180. {
  1181. return 3;
  1182. }
  1183. else if (slotIndex == 5)
  1184. {
  1185. return 4;
  1186. }
  1187. else if (slotIndex == 7)
  1188. {
  1189. return 5;
  1190. }
  1191. else if (slotIndex == 8)
  1192. {
  1193. return 6;
  1194. }
  1195. else
  1196. {
  1197. throw new Exception();
  1198. }
  1199. }
  1200. public void OnApplicationPause(bool pause)
  1201. {
  1202. if (!pause)
  1203. {
  1204. if (!ManaTutorial.TutorialA)
  1205. {
  1206. if (Game || Prepare)
  1207. {
  1208. ManaReso.Get<Button>("D_Quit").onClick.Invoke();
  1209. }
  1210. }
  1211. }
  1212. }
  1213. }
  1214. #region DebugList
  1215. //结束界面的图标能否重复显示
  1216. #endregion