Ability.cs 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759
  1. using UnityEngine;
  2. using UnityEngine.UI;
  3. using System;
  4. using System.Xml;
  5. using System.Text;
  6. using System.Collections;
  7. using System.Collections.Generic;
  8. using Random = UnityEngine.Random;
  9. public class Ability : SkillRoot
  10. {
  11. #region 变量
  12. #region 配置
  13. public float UnlockAheadAmt
  14. {
  15. get { return UnlockAheadBaseAmt + (UnlockLv - ManaCenter.Level - 1)*UnlockAheadDeltaAmt; }
  16. }
  17. public override string ID
  18. {
  19. get { return "Ability" + ID_; }
  20. }
  21. public float Person;
  22. public float SkillCD;
  23. public float CoinPerson;
  24. public double UpgradeAmt;
  25. public float Plus;
  26. public float PersonBuff;
  27. public float SkillCdBuff;
  28. public int UnlockLv;
  29. public float UnlockAmt;
  30. public float UnlockAheadBaseAmt;
  31. public float UnlockAheadDeltaAmt;
  32. public string UnlockPos;
  33. public Current UnlockCur;
  34. public Current UpgradeCur;
  35. public Current UnlockAheadCur;
  36. public string Label;
  37. public string Anim;
  38. public string UpgradeCD;
  39. public string UpgradeFml;
  40. public string UpgradePlus;
  41. public string UpgradePerson;
  42. #endregion
  43. public bool ElfLock = true;
  44. public string Elf;
  45. public string Item;
  46. public float NewPlus;
  47. public float NewPerson;
  48. public float NewSkillCD;
  49. public float NewSkillCdBuff;
  50. public float NewPersonBuff;
  51. public float NewCoinPerson;
  52. public double NewUpgradeAmt;
  53. public override SkillStatus ItemStatus
  54. {
  55. get { return ItemStatus_; }
  56. set
  57. {
  58. ItemStatus_ = value;
  59. if (ItemStatus_ == SkillStatus.Lock)
  60. {
  61. if (UnlockAheadCur == Current.Free)
  62. {
  63. ItemBtn.interactable = false;
  64. ManaLan.Add(ItemBtnLab, new LanStr("UI", "Fe_BtnLab1"), "\n", new LanStr("UI", "Fe_BtnLab4"), UnlockLv.ToString());
  65. }
  66. else
  67. {
  68. ItemBtn.interactable = true;
  69. ManaLan.Add(ItemBtnLab, new LanStr("UI", "Fe_BtnLab0"), "\n", new LanStr("UI", "Fe_BtnLab4"), UnlockLv.ToString());
  70. }
  71. }
  72. else if (ItemStatus_ == SkillStatus.UnLock)
  73. {
  74. ItemBtn.interactable = true;
  75. ItemBtnLab.text = Language.GetStr("UI", "Fe_BtnLab1") + "\n" + Auxiliary.ImageParse(UnlockCur) + Auxiliary.ShrinkNumberStr(UnlockAmt);
  76. }
  77. else if (ItemStatus_ == SkillStatus.Upgrade)
  78. {
  79. ItemBtn.interactable = true;
  80. ItemBtnLab.text = Language.GetStr("UI", "Fe_BtnLab2") + "\n" + Auxiliary.ImageParse(UpgradeCur) + Auxiliary.ShrinkNumberStr(NewUpgradeAmt);
  81. }
  82. }
  83. }
  84. #endregion
  85. public Ability(XmlAttributeCollection attribute)
  86. {
  87. #region 配置
  88. ID_ = int.Parse(attribute[0].Value);
  89. Icon_ = attribute[21].Value;
  90. Anim = attribute[22].Value;
  91. Label = attribute[23].Value;
  92. UnlockPos = attribute[13].Value;
  93. UpgradeCD = attribute[19].Value;
  94. UpgradeFml = attribute[16].Value;
  95. UpgradePlus = attribute[17].Value;
  96. UpgradePerson = attribute[18].Value;
  97. UnlockLv = Auxiliary.IntParse(attribute[7].Value,0);
  98. ItemIndex = Auxiliary.IntParse(attribute[3].Value,0);
  99. UnlockAmt = Auxiliary.FloatParse(attribute[12].Value,0);
  100. UnlockAheadBaseAmt = Auxiliary.FloatParse(attribute[10].Value,0);
  101. UnlockAheadDeltaAmt = Auxiliary.FloatParse(attribute[9].Value, 0);
  102. SkillTab = SkillClassParse(attribute[2].Value);
  103. UpgradeAmt = UpgradeAmtParse(attribute[15].Value);
  104. UnlockCur = Auxiliary.CurrentParse(attribute[11].Value);
  105. UpgradeCur = Auxiliary.CurrentParse(attribute[14].Value);
  106. UnlockAheadCur = Auxiliary.CurrentParse(attribute[8].Value);
  107. ValueBuffParse(out Person, out PersonBuff, attribute[5].Value);
  108. ValueBuffParse(out SkillCD, out SkillCdBuff, attribute[6].Value);
  109. ValueBuffParse(out CoinPerson, out Plus, attribute[4].Value);
  110. #endregion
  111. SkillType = SkillType.Ability;
  112. }
  113. public void UnlockTab()
  114. {
  115. ManaReso.Get<Graphic>("F_Elf").material = null;
  116. ManaReso.Get<Graphic>("F_Store").material = null;
  117. ManaReso.Get<Graphic>("F_Magic").material = null;
  118. ManaReso.Get<Graphic>("F_ElfLab").material = null;
  119. ManaReso.Get<Graphic>("F_StoreLab").material = null;
  120. ManaReso.Get<Graphic>("F_MagicLab").material = null;
  121. ManaReso.Get<Button>("F_Elf").interactable = true;
  122. ManaReso.Get<Button>("F_Store").interactable = true;
  123. ManaReso.Get<Button>("F_Magic").interactable = true;
  124. }
  125. public override void Reactive()
  126. {
  127. //if (Level > 0)
  128. //{
  129. // AnnulA();
  130. // AnnulB();
  131. //}
  132. }
  133. public override void RegistValue(bool firstRegist, float elapse, List<List<Skill>> useList, XmlAttributeCollection attribute)
  134. {
  135. if (!firstRegist)
  136. {
  137. return;
  138. }
  139. Level = int.Parse(attribute[3].Value);
  140. ItemStatus_ = (SkillStatus)Enum.Parse(typeof(SkillStatus), attribute[2].Value);
  141. NewPlus = Plus;
  142. NewPerson = Person;
  143. NewSkillCD = SkillCD;
  144. NewSkillCdBuff = SkillCdBuff;
  145. NewPersonBuff = PersonBuff;
  146. NewCoinPerson = CoinPerson;
  147. NewUpgradeAmt = UpgradeAmt;
  148. if (ID == "Ability1")
  149. {
  150. ManaCenter.Level = Level;
  151. if (Level > 0)
  152. {
  153. UnlockTab();
  154. }
  155. }
  156. if (ItemStatus_ == SkillStatus.Lock || ItemStatus_ == SkillStatus.UnLock)
  157. {
  158. ItemIcon.material = Lib.GrayMat;
  159. }
  160. else
  161. {
  162. ItemIcon.material = null;
  163. }
  164. if (ItemStatus_ == SkillStatus.Upgrade)
  165. {
  166. for (int i = 0; i < Level - 1; i++)
  167. {
  168. NewUpgradeAmt = Auxiliary.FmlParse(UpgradeFml, "a", NewUpgradeAmt.ToString("0.00"));
  169. }
  170. UpgradeValue(ref NewPlus, UpgradePlus, Level - 1);
  171. UpgradeValue(ref NewPersonBuff, UpgradePerson, Level - 1);
  172. UpgradeSkillCdBuff(ref NewSkillCdBuff, UpgradeCD, Level - 1);
  173. UpgradeValue(ref NewPerson, Person, UpgradePerson, Level - 1);
  174. UpgradeValue(ref NewSkillCD, SkillCD, UpgradeCD, Level - 1);
  175. UpgradeValue(ref NewCoinPerson, CoinPerson, UpgradePlus, Level - 1);
  176. UseA();
  177. UseC();
  178. }
  179. else if (ItemStatus_ == SkillStatus.UnLock)
  180. {
  181. ManaUI.UpdateHint();
  182. }
  183. ItemStatus = ItemStatus;
  184. ItemBtn.onClick.RemoveAllListeners();
  185. ItemBtn.onClick.AddListener(OnClick);
  186. ItemLab.text = GetDescription(0);
  187. }
  188. public override void SwitchLanguage()
  189. {
  190. base.SwitchLanguage();
  191. ItemStatus = ItemStatus;
  192. }
  193. protected void UseA()
  194. {
  195. if (ElfLock)
  196. {
  197. ElfLock = false;
  198. if (!string.IsNullOrEmpty(Anim))
  199. {
  200. if (Anim.Contains("Elf"))
  201. {
  202. string[] strings = Anim.Split(',');
  203. for (int i = 1; i < strings.Length; i++)
  204. {
  205. ManaGarden.ElfList.Add(strings[i].ToEnum<ElfType>());
  206. }
  207. Elf = strings[1];
  208. }
  209. else if (Anim.Contains("Item"))
  210. {
  211. string[] strings = Anim.Split(',');
  212. for (int i = 1; i < strings.Length; i++)
  213. {
  214. ManaReso.Get(strings[i]).TweenForSr();
  215. }
  216. Item = strings[1];
  217. }
  218. }
  219. }
  220. ManaCenter.Person += NewPerson;
  221. ManaCenter.CoinPerson += NewCoinPerson;
  222. ManaCenter.SkillPlus += NewPlus;
  223. ManaCenter.SkillPersonBuff += NewPersonBuff;
  224. if (!NewSkillCD.Equal(0))
  225. {
  226. for (int i = 0; i < ManaCenter.SkillList.Count; i++)
  227. {
  228. ManaCenter.SkillList[i].ReceiveCool(NewSkillCD, false, false);
  229. }
  230. }
  231. if (!NewSkillCdBuff.Equal(0))
  232. {
  233. for (int i = 0; i < ManaCenter.SkillList.Count; i++)
  234. {
  235. ManaCenter.SkillList[i].ReceiveCool(NewSkillCdBuff, false, true);
  236. }
  237. }
  238. }
  239. protected void UseB()
  240. {
  241. if (!string.IsNullOrEmpty(Elf))
  242. {
  243. ManaCenter.ElfLevel++;
  244. }
  245. }
  246. protected void UseC()
  247. {
  248. for (int i = 0; i < Auxiliary.IntParse(UnlockPos, 0); i++)
  249. {
  250. ManaGarden.UnlockSlot();
  251. }
  252. }
  253. protected void Zoom()
  254. {
  255. if (!string.IsNullOrEmpty(Elf))
  256. {
  257. if (ManaGarden.PlantList.Count <= Garden.CurPage * 9)
  258. {
  259. return;
  260. }
  261. ManaGarden.ElfTimer = Random.Range(5f, 30f);
  262. Slot zoomSlot = ManaGarden.PlantList.Random(1, false, false, slot => { return slot.Index >= Garden.CurPage*9; })[0];
  263. if (zoomSlot.Index%9 == 4)
  264. {
  265. return;
  266. }
  267. Flower flower = zoomSlot.Flower;
  268. flower.GetElf(ManaGarden.ElfList.Back(0), 0, 0, 0, 0);
  269. ManaReso.Get("Fe_Info").TweenBacCG();
  270. ManaReso.Get("F_Manage").TweenBacGra();
  271. TweenRoot tween = ManaReso.Get("F_Manage0").GetTweenVec();
  272. tween.AddEventOnetime
  273. (
  274. EventType.BackwardFinish,
  275. () =>
  276. {
  277. ManaReso.Get("MainCamera").Zoom2D(1.5f, 3f, 1, flower.ElfList.Back(0), Curve.EaseOutQuad);
  278. }
  279. );
  280. }
  281. else if (!string.IsNullOrEmpty(Item))
  282. {
  283. TweenRoot tween = ManaReso.Get(Item).GetTweenSr();
  284. Vector3 pos = ManaReso.Get(Item).position;
  285. pos.z = -2;
  286. tween.AddEventOnetime
  287. (
  288. EventType.ForwardFinish,
  289. () =>
  290. {
  291. ManaReso.GetFirework(pos);
  292. }
  293. );
  294. ManaReso.Get("Fe_Info").TweenBacCG();
  295. ManaReso.Get("F_Manage").TweenBacGra();
  296. tween = ManaReso.Get("F_Manage0").GetTweenVec();
  297. tween.AddEventOnetime
  298. (
  299. EventType.BackwardFinish,
  300. () =>
  301. {
  302. ManaReso.Get("MainCamera").Zoom2D(3.5f, 3f, 1, ManaReso.Get(Item), Curve.EaseOutQuad);
  303. }
  304. );
  305. }
  306. }
  307. protected void Unlock()
  308. {
  309. ManaCenter.Pay
  310. (
  311. ID,
  312. UnlockAmt,
  313. UnlockCur,
  314. () =>
  315. {
  316. ManaAudio.PlayClip(Clip.SkillClip);
  317. ItemIcon.material = null;
  318. ItemStatus = SkillStatus.Upgrade;
  319. if (UnlockCur != Current.Free)
  320. {
  321. ManaUI.UpdateHint();
  322. }
  323. Level = 1;
  324. UseA();
  325. UseB();
  326. UseC();
  327. Zoom();
  328. if (ID == "Ability1")
  329. {
  330. ManaCenter.Level = 1;
  331. UnlockTab();
  332. }
  333. },
  334. StaticsManager.ConsumeModule.Shop
  335. );
  336. }
  337. protected void OnClick()
  338. {
  339. ManaAudio.PlayClip(Clip.BtnClip);
  340. ManaReso.Get("Fe_Info").TweenForCG();
  341. ManaReso.SetText("Fe_Tit", Name);
  342. ManaReso.SetSprite("Fe_Icon", Icon);
  343. if (ItemStatus == SkillStatus.Lock)
  344. {
  345. ManaReso.SetText("Fe_Lab0", "");
  346. ManaReso.SetText("Fe_Lab1", GetDescription(0));
  347. ManaReso.SetText("Fe_BtnLab", string.Format("{0}({1}{2:0})", Language.GetStr("UI", "Fe_BtnLab0"), Auxiliary.ImageParse(UnlockAheadCur), UnlockAheadAmt.ToString("0")));
  348. ManaReso.SetButtonEvent
  349. (
  350. "Fe_Btn",
  351. () =>
  352. {
  353. UnlockAhead();
  354. ManaReso.Get("Fe_Info").TweenBacCG();
  355. }
  356. );
  357. }
  358. else if (ItemStatus == SkillStatus.UnLock)
  359. {
  360. ManaReso.SetText("Fe_Lab0", "");
  361. ManaReso.SetText("Fe_Lab1", GetDescription(0));
  362. ManaReso.SetText("Fe_BtnLab", string.Format("{0}({1}{2:0})", Language.GetStr("UI", "Fe_BtnLab1"), Auxiliary.ImageParse(UnlockCur), UnlockAmt.ToString("0")));
  363. ManaReso.SetButtonEvent
  364. (
  365. "Fe_Btn",
  366. () =>
  367. {
  368. Unlock();
  369. ManaReso.Get("Fe_Info").TweenBacCG();
  370. }
  371. );
  372. }
  373. else if (ItemStatus == SkillStatus.Upgrade)
  374. {
  375. ManaReso.SetText("Fe_Lab0", GetDescription(0));
  376. ManaReso.SetText("Fe_Lab1", GetDescription(1));
  377. ManaReso.SetText("Fe_BtnLab", string.Format("{0}({1}{2:0})", Language.GetStr("UI", "Fe_BtnLab2"), Auxiliary.ImageParse(UpgradeCur), Auxiliary.ShrinkNumberStr(NewUpgradeAmt)));
  378. ManaReso.SetButtonEvent
  379. (
  380. "Fe_Btn",
  381. () =>
  382. {
  383. Upgrade();
  384. ItemLab.text = GetDescription(0);
  385. ItemBtnLab.text = Language.GetStr("UI", "Fe_BtnLab2") + "\n" + Auxiliary.ImageParse(UpgradeCur) + Auxiliary.ShrinkNumberStr(NewUpgradeAmt);
  386. ManaReso.SetText("Fe_Tit", Name);
  387. ManaReso.SetText("Fe_Lab0", GetDescription(0));
  388. ManaReso.SetText("Fe_Lab1", GetDescription(1));
  389. ManaReso.SetText("Fe_BtnLab", string.Format("{0}({1}{2:0})", Language.GetStr("UI", "Fe_BtnLab2"), Auxiliary.ImageParse(UpgradeCur), Auxiliary.ShrinkNumberStr(NewUpgradeAmt)));
  390. }
  391. );
  392. }
  393. }
  394. protected void Upgrade()
  395. {
  396. ManaCenter.Pay
  397. (
  398. ID,
  399. NewUpgradeAmt,
  400. UpgradeCur,
  401. () =>
  402. {
  403. ManaAudio.PlayClip(Clip.SkillClip);
  404. Level++;
  405. AnnulA();
  406. NewUpgradeAmt = Auxiliary.FmlParse(UpgradeFml, "a", NewUpgradeAmt.ToString("0.00"));
  407. UpgradeValue(ref NewPlus, UpgradePlus, 1);
  408. UpgradeValue(ref NewPersonBuff, UpgradePerson, 1);
  409. UpgradeSkillCdBuff(ref NewSkillCdBuff, UpgradeCD, 1);
  410. UpgradeValue(ref NewPerson, Person, UpgradePerson, 1);
  411. UpgradeValue(ref NewSkillCD, SkillCD, UpgradeCD, 1);
  412. UpgradeValue(ref NewCoinPerson, CoinPerson, UpgradePlus, 1);
  413. UseA();
  414. UseB();
  415. if (ID == "Ability1")
  416. {
  417. ManaCenter.Level++;
  418. }
  419. },
  420. StaticsManager.ConsumeModule.Shop
  421. );
  422. }
  423. protected void UnlockAhead()
  424. {
  425. ManaCenter.Pay
  426. (
  427. ID,
  428. UnlockAheadAmt,
  429. UnlockAheadCur,
  430. () =>
  431. {
  432. ManaAudio.PlayClip(Clip.SkillClip);
  433. if (UnlockCur == Current.Free)
  434. {
  435. Unlock();
  436. }
  437. else
  438. {
  439. ItemStatus = SkillStatus.UnLock;
  440. }
  441. },
  442. StaticsManager.ConsumeModule.Shop
  443. );
  444. }
  445. public virtual void AnnulB()
  446. {
  447. //for (int i = 0; i < Auxiliary.IntParse(UnlockPos, 0); i++)
  448. //{
  449. // ManaGarden.LockSlot();
  450. //}
  451. }
  452. public override void AnnulA()
  453. {
  454. ManaCenter.Person -= NewPerson;
  455. ManaCenter.CoinPerson -= NewCoinPerson;
  456. ManaCenter.SkillPlus -= NewPlus;
  457. ManaCenter.SkillPersonBuff -= NewPersonBuff;
  458. if (Math.Abs(NewSkillCD) > 0.0005f)
  459. {
  460. for (int i = 0; i < ManaCenter.SkillList.Count; i++)
  461. {
  462. ManaCenter.SkillList[i].ReceiveCool(-NewSkillCD, false, false);
  463. }
  464. }
  465. if (Math.Abs(NewSkillCdBuff) > 0.0005f)
  466. {
  467. for (int i = 0; i < ManaCenter.SkillList.Count; i++)
  468. {
  469. ManaCenter.SkillList[i].ReceiveCool(-NewSkillCdBuff, false, true);
  470. }
  471. }
  472. }
  473. public override void UpdateStatus()
  474. {
  475. if (!ManaCenter.Complete)
  476. {
  477. return;
  478. }
  479. if (ManaCenter.Level >= UnlockLv)
  480. {
  481. if (ItemStatus == SkillStatus.Lock)
  482. {
  483. if (UnlockCur == Current.Free)
  484. {
  485. Unlock();
  486. }
  487. else
  488. {
  489. ItemStatus = SkillStatus.UnLock;
  490. ManaUI.UpdateHint();
  491. }
  492. }
  493. }
  494. }
  495. #region 解读器
  496. protected double UpgradeAmtParse(string str)
  497. {
  498. if (string.IsNullOrEmpty(str))
  499. {
  500. return UnlockAmt;
  501. }
  502. else
  503. {
  504. return double.Parse(str);
  505. }
  506. }
  507. protected override string GetDescription(int offset)
  508. {
  509. float temp;
  510. string[] strings = Desc.Split('[', ']');
  511. StringBuilder stringBuilder = new StringBuilder();
  512. for (int i = 0; i < strings.Length; i++)
  513. {
  514. if (strings[i].Contains("lv"))
  515. {
  516. }
  517. else if (strings[i].Contains("&person&"))
  518. {
  519. #region MyRegion
  520. if (!Person.Equal(0))
  521. {
  522. temp = NewPerson;
  523. UpgradeValue(ref temp, Person, UpgradePerson, offset);
  524. UpgradeUnit(ref temp, strings[i]);
  525. float remainder = temp % 1;
  526. if (remainder > 0)
  527. {
  528. stringBuilder.Append(temp.ToString("0") + "+");
  529. }
  530. else
  531. {
  532. stringBuilder.Append(temp.ToString("0"));
  533. }
  534. }
  535. else if (!PersonBuff.Equal(0))
  536. {
  537. temp = NewPersonBuff;
  538. UpgradeValue(ref temp, UpgradePerson, offset);
  539. stringBuilder.Append(string.Format("{0:0}%", temp * 100));
  540. }
  541. #endregion
  542. }
  543. else if (strings[i].Contains("&skill_cd&"))
  544. {
  545. #region MyRegion
  546. if (!SkillCD.Equal(0))
  547. {
  548. temp = NewSkillCD;
  549. UpgradeValue(ref temp, SkillCD, UpgradeCD, offset);
  550. UpgradeUnit(ref temp, strings[i]);
  551. stringBuilder.Append(temp.ToString("0"));
  552. }
  553. else if (!SkillCdBuff.Equal(0))
  554. {
  555. temp = NewSkillCdBuff;
  556. UpgradeSkillCdBuff(ref temp, UpgradeCD, offset);
  557. stringBuilder.Append(string.Format("{0:0}%", temp * 100));
  558. }
  559. #endregion
  560. }
  561. else if (strings[i].Contains("&coin_person&"))
  562. {
  563. #region MyRegion
  564. if (!CoinPerson.Equal(0))
  565. {
  566. temp = NewCoinPerson;
  567. UpgradeValue(ref temp, CoinPerson, UpgradePlus, offset);
  568. UpgradeUnit(ref temp, strings[i]);
  569. float remainder = temp % 1;
  570. if (remainder > 0)
  571. {
  572. stringBuilder.Append(temp.ToString("0") + "+");
  573. }
  574. else
  575. {
  576. stringBuilder.Append(temp.ToString("0"));
  577. }
  578. }
  579. else if (!Plus.Equal(0))
  580. {
  581. temp = NewPlus;
  582. UpgradeValue(ref temp, UpgradePlus, offset);
  583. stringBuilder.Append(string.Format("{0:0}%", temp * 100));
  584. }
  585. #endregion
  586. }
  587. else
  588. {
  589. stringBuilder.Append(strings[i]);
  590. }
  591. }
  592. return stringBuilder.ToString();
  593. }
  594. #endregion
  595. }