ManaVisit.cs 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798
  1. using LitJson;
  2. using UnityEngine;
  3. using UnityEngine.UI;
  4. using UnityEngine.Events;
  5. using System.Xml;
  6. using System.Collections;
  7. using System.Collections.Generic;
  8. public class ManaVisit
  9. {
  10. #region 变量
  11. #region 配置
  12. public static int Cost
  13. {
  14. get { return Cost_; }
  15. set
  16. {
  17. Cost_ = value;
  18. ManaReso.Get<Text>("C_CostLab").text = "<(金币)>" + Cost;
  19. }
  20. }
  21. public static int Cost_;
  22. public static int CoolTime;
  23. public static float FancyRate;
  24. public static float AwardRate;
  25. public static float CreateRate;
  26. public static string CostFml;
  27. public static string AwardMinFml;
  28. public static string AwardMaxFml;
  29. #endregion
  30. public static bool InVisit;
  31. public static bool Complete;
  32. public static bool LoadComplete;
  33. public static bool TweenComplete;
  34. public static string XmlStr;
  35. public static int Slot;
  36. public static int Level;
  37. public static XmlNode Node;
  38. public static XmlDocument Document;
  39. public static bool OriginBird;
  40. public static bool OriginTree;
  41. public static bool OriginRainbow;
  42. public static List<Slot> VisitPlantList;
  43. public static List<Slot> OriginPlantList;
  44. public static List<ElfType> OriginElfList;
  45. #endregion
  46. public static void Initialize()
  47. {
  48. XmlAttributeCollection attribute = ManaData.GetVisitConfig();
  49. CostFml = attribute[5].Value;
  50. Cost = Mathf.FloorToInt((float)Auxiliary.FmlParse(CostFml, "l", ManaCenter.Level.ToString()));
  51. AwardMinFml = attribute[2].Value;
  52. AwardMaxFml = attribute[3].Value;
  53. CoolTime = int.Parse(attribute[4].Value);
  54. FancyRate = float.Parse(attribute[7].Value);
  55. AwardRate = float.Parse(attribute[1].Value);
  56. CreateRate = float.Parse(attribute[6].Value);
  57. #region 倒计时
  58. if (CoolTime != 0)
  59. {
  60. Text text = ManaReso.Get<Text>("C_VisitLab");
  61. List<float> delayList = new List<float>();
  62. List<float> durationList = new List<float>();
  63. List<VecPair> pairList = new List<VecPair>();
  64. List<UnityAction> actionList = new List<UnityAction>();
  65. Vector3 v1 = new Vector3(0.75f, 0.75f, 0.75f);
  66. Vector3 v2 = new Vector3(0.4f, 0.4f, 0.4f);
  67. Vector3 v3 = new Vector3(0, 0, 0);
  68. for (int i = 0; i < CoolTime - 1; i++)
  69. {
  70. delayList.Add(0.5f);
  71. delayList.Add(0);
  72. }
  73. delayList.Add(0.5f);
  74. for (int i = 0; i < CoolTime; i++)
  75. {
  76. durationList.Add(0.25f);
  77. durationList.Add(0.25f);
  78. pairList.Add(new VecPair(v1, v2));
  79. pairList.Add(new VecPair(v2, v3));
  80. var tempInt = i;
  81. actionList.Add
  82. (
  83. () =>
  84. {
  85. text.text = (CoolTime - tempInt).ToString();
  86. ManaAudio.PlayClip(Clip.BtnClip);
  87. }
  88. );
  89. actionList.Add(null);
  90. }
  91. TweenRoot tween = ManaReso.Get("C_VisitLab").CreateStreamScale
  92. (
  93. delayList,
  94. durationList,
  95. pairList,
  96. true,
  97. false,
  98. Curve.EaseOutQuad,
  99. false,
  100. actionList
  101. );
  102. tween.OnForwardFinish += () =>
  103. {
  104. ManaAudio.PlayClip(Clip.BubbleClip);
  105. };
  106. }
  107. #endregion
  108. Complete = true;
  109. }
  110. public static void Exit()
  111. {
  112. TweenRoot tweenRoot = ManaReso.Get("I_BlackMask").TweenForCG();
  113. tweenRoot.AddEventOnetime
  114. (
  115. EventType.ForwardFinish,
  116. () =>
  117. {
  118. ManaPlayer.Player.SetAllCollider(true);
  119. }
  120. );
  121. HideTip ();
  122. ManaReso.SetActive("C_Visit", true);
  123. ManaReso.SetActive("C_Coin", true);
  124. ManaReso.SetActive("C_Group1", true);
  125. ManaReso.SetActive("C_Group2", true);
  126. ManaReso.SetActive("C_Return", false);
  127. ManaReso.SetActive("C_Garden", false);
  128. ManaGarden.MiniLock = true;
  129. #region Garden
  130. ManaGarden.RetriveFlowerAll();
  131. for (int i = 0; i < ManaGarden.PageList.Count; i++)
  132. {
  133. ManaReso.Save(ManaGarden.PageList[i]);
  134. }
  135. ManaGarden.PageList = new List<Transform>();
  136. Garden.CurPage = 0;
  137. ManaGarden.SlotList = new List<Slot>();
  138. ManaGarden.PageList = new List<Transform>();
  139. Garden.ResetPage();
  140. Garden.PagePos = new List<Vector3>();
  141. int pageAmt = 2;
  142. if (ManaGarden.Slot >= 7)
  143. {
  144. pageAmt = (ManaGarden.Slot - 7)/9 + 3;
  145. }
  146. for (int i = 0; i < pageAmt; i++)
  147. {
  148. ManaGarden.CreatePage();
  149. }
  150. for (int i = 0; i < ManaGarden.SlotList.Count; i++)
  151. {
  152. if (i < ManaGarden.Slot)
  153. {
  154. ManaGarden.SlotList[i].Lock = true;
  155. ManaGarden.SlotList[i].Available = true;
  156. }
  157. else
  158. {
  159. ManaGarden.SlotList[i].Lock = false;
  160. ManaGarden.SlotList[i].Available = false;
  161. }
  162. }
  163. List<KV<int, int>> plantList = ManaData.GetPlantList();
  164. for (int i = 0; i < plantList.Count; i++)
  165. {
  166. ManaGarden.PlantFlower(plantList[i].Key, plantList[i].Value);
  167. }
  168. #endregion
  169. #region Bird Tree Rainbow
  170. if (OriginBird)
  171. {
  172. ManaReso.Get("Bird0").GetTweenSr().InDestination = true;
  173. }
  174. else
  175. {
  176. ManaReso.Get("Bird0").GetTweenSr().InOrigin = true;
  177. }
  178. if (OriginTree)
  179. {
  180. ManaReso.Get("Tree1").GetTweenSr().InDestination = true;
  181. ManaReso.Get("Tree2").GetTweenSr().InDestination = true;
  182. }
  183. else
  184. {
  185. ManaReso.Get("Tree1").GetTweenSr().InOrigin = true;
  186. ManaReso.Get("Tree2").GetTweenSr().InOrigin = true;
  187. }
  188. if (OriginRainbow)
  189. {
  190. ManaReso.Get("Rainbow").GetTweenSr().InDestination = true;
  191. }
  192. else
  193. {
  194. ManaReso.Get("Rainbow").GetTweenSr().InOrigin = true;
  195. }
  196. #endregion
  197. #region Player
  198. ManaReso.Save(ManaPlayer.Player);
  199. ManaReso.TraDic.Remove("Player");
  200. ManaPlayer.Instance.GetPlayer();
  201. Garden.PlayerPos = new List<Vector3>();
  202. Garden.Player = ManaReso.Get("Player");
  203. Garden.PlayerPos.Add(ManaPlayer.Player.ChildDic["Pos1"].position);
  204. Garden.PlayerPos.Add(ManaPlayer.Player.ChildDic["Pos2"].position);
  205. #endregion
  206. ManaGarden.ElfList = new List<ElfType>(OriginElfList);
  207. InVisit = false;
  208. }
  209. public static void Enter()
  210. {
  211. if (!LoadComplete || !TweenComplete)
  212. {
  213. return;
  214. }
  215. ManaReso.Get("I_BlackMask").TweenForCG();
  216. ShowTip ();
  217. Document = new XmlDocument();
  218. Document.LoadXml(XmlStr);
  219. Node = Document.SelectSingleNode("PlayerConfig");
  220. ManaReso.SetActive("C_Coin", false);
  221. ManaReso.SetActive("C_Group1", false);
  222. ManaReso.SetActive("C_Group2", false);
  223. ManaReso.SetActive("C_Garden", true);
  224. if (!InVisit)
  225. {
  226. for (int i = 0; i < ManaGarden.StarList.Count; i++)
  227. {
  228. ManaReso.Save(ManaGarden.StarList[i]);
  229. }
  230. ManaGarden.StarList = new List<Star>();
  231. }
  232. ManaReso.SetActive("C_Return", true);
  233. ManaGarden.MiniLock = false;
  234. #region Bird Tree Rainbow
  235. if (!InVisit)
  236. {
  237. if (ManaReso.Get("Bird0").gameObject.activeSelf)
  238. {
  239. OriginBird = true;
  240. }
  241. if (ManaReso.Get("Tree1").gameObject.activeSelf)
  242. {
  243. OriginTree = true;
  244. }
  245. if (ManaReso.Get("Rainbow").gameObject.activeSelf)
  246. {
  247. OriginRainbow = true;
  248. }
  249. }
  250. ManaReso.SetActive("Bird0", false);
  251. ManaReso.SetActive("Tree1", false);
  252. ManaReso.SetActive("Tree2", false);
  253. ManaReso.SetActive("Rainbow", false);
  254. #endregion
  255. #region Ability
  256. Slot = 1;
  257. if (!InVisit)
  258. {
  259. OriginElfList = new List<ElfType>(ManaGarden.ElfList);
  260. }
  261. ManaGarden.ElfList = new List<ElfType>();
  262. List<XmlAttributeCollection> attributeList = ManaData.GetSkillList(Node);
  263. for (int i = 0; i < attributeList.Count; i++)
  264. {
  265. if (!attributeList[i][0].Value.Contains("Ability"))
  266. {
  267. continue;
  268. }
  269. if (attributeList[i][0].Value == "Ability1")
  270. {
  271. Level = int.Parse(attributeList[i][3].Value);
  272. ManaReso.SetText("C_GardenLab", Language.GetStr("UI", "C_GardenLab") + Level);
  273. continue;
  274. }
  275. if (int.Parse(attributeList[i][3].Value) == 0)
  276. {
  277. continue;
  278. }
  279. if (attributeList[i][0].Value == "Ability2")
  280. {
  281. ManaReso.Get("Rainbow").GetTweenSr().InDestination = true;
  282. }
  283. else if (attributeList[i][0].Value == "Ability3")
  284. {
  285. ManaReso.Get("Tree1").GetTweenSr().InDestination = true;
  286. ManaReso.Get("Tree2").GetTweenSr().InDestination = true;
  287. }
  288. else if (attributeList[i][0].Value == "Ability4")
  289. {
  290. ManaReso.Get("Bird0").GetTweenSr().InDestination = true;
  291. }
  292. else if (attributeList[i][0].Value == "Ability5")
  293. {
  294. ManaGarden.ElfList.Add(ElfType.Bee_Yellow);
  295. }
  296. else if (attributeList[i][0].Value == "Ability6")
  297. {
  298. Slot++;
  299. ManaGarden.ElfList.Add(ElfType.Bee_Purple);
  300. }
  301. else if (attributeList[i][0].Value == "Ability7")
  302. {
  303. Slot++;
  304. ManaGarden.ElfList.Add(ElfType.Bee_Blue);
  305. }
  306. else if (attributeList[i][0].Value == "Ability8")
  307. {
  308. Slot++;
  309. ManaGarden.ElfList.Add(ElfType.Bee_Red);
  310. }
  311. else if (attributeList[i][0].Value == "Ability9")
  312. {
  313. Slot++;
  314. ManaGarden.ElfList.Add(ElfType.Bee_White);
  315. }
  316. else if (attributeList[i][0].Value == "Ability10")
  317. {
  318. Slot++;
  319. ManaGarden.ElfList.Add(ElfType.Butterfly_Yellow);
  320. }
  321. else if (attributeList[i][0].Value == "Ability11")
  322. {
  323. Slot++;
  324. ManaGarden.ElfList.Add(ElfType.Butterfly_Purple);
  325. }
  326. else if (attributeList[i][0].Value == "Ability12")
  327. {
  328. Slot++;
  329. ManaGarden.ElfList.Add(ElfType.Butterfly_Blue);
  330. }
  331. else if (attributeList[i][0].Value == "Ability13")
  332. {
  333. Slot++;
  334. ManaGarden.ElfList.Add(ElfType.Butterfly_Red);
  335. }
  336. else if (attributeList[i][0].Value == "Ability14")
  337. {
  338. Slot++;
  339. ManaGarden.ElfList.Add(ElfType.Butterfly_White);
  340. }
  341. else if (attributeList[i][0].Value == "Ability15")
  342. {
  343. Slot++;
  344. ManaGarden.ElfList.Add(ElfType.Dragonfly_Yellow);
  345. }
  346. else if (attributeList[i][0].Value == "Ability16")
  347. {
  348. Slot++;
  349. ManaGarden.ElfList.Add(ElfType.Dragonfly_Purple);
  350. }
  351. else if (attributeList[i][0].Value == "Ability17")
  352. {
  353. Slot++;
  354. ManaGarden.ElfList.Add(ElfType.Dragonfly_Blue);
  355. }
  356. else if (attributeList[i][0].Value == "Ability18")
  357. {
  358. Slot++;
  359. ManaGarden.ElfList.Add(ElfType.Dragonfly_Red);
  360. }
  361. else if (attributeList[i][0].Value == "Ability19")
  362. {
  363. Slot++;
  364. ManaGarden.ElfList.Add(ElfType.Dragonfly_White);
  365. }
  366. else if (attributeList[i][0].Value == "Ability20")
  367. {
  368. Slot++;
  369. ManaGarden.ElfList.Add(ElfType.Beetle_Yellow);
  370. }
  371. else if (attributeList[i][0].Value == "Ability21")
  372. {
  373. Slot++;
  374. ManaGarden.ElfList.Add(ElfType.Beetle_Purple);
  375. }
  376. else if (attributeList[i][0].Value == "Ability22")
  377. {
  378. Slot++;
  379. ManaGarden.ElfList.Add(ElfType.Beetle_Blue);
  380. }
  381. else if (attributeList[i][0].Value == "Ability23")
  382. {
  383. Slot++;
  384. ManaGarden.ElfList.Add(ElfType.Beetle_Red);
  385. }
  386. else if (attributeList[i][0].Value == "Ability24")
  387. {
  388. Slot++;
  389. ManaGarden.ElfList.Add(ElfType.Beetle_White);
  390. }
  391. }
  392. #endregion
  393. #region Garden
  394. if (!InVisit)
  395. {
  396. OriginPlantList = new List<Slot>(ManaGarden.PlantList);
  397. ManaData.SaveDress();
  398. ManaData.SavePlantList();
  399. }
  400. ManaGarden.RetriveFlowerAll();
  401. for (int i = 0; i < ManaGarden.PageList.Count; i++)
  402. {
  403. ManaReso.Save(ManaGarden.PageList[i]);
  404. }
  405. ManaGarden.PageList = new List<Transform>();
  406. Garden.CurPage = 0;
  407. ManaGarden.SlotList = new List<Slot>();
  408. ManaGarden.PageList = new List<Transform>();
  409. Garden.ResetPage();
  410. Garden.PagePos = new List<Vector3>();
  411. int pageAmt = 2;
  412. if (Slot >= 7)
  413. {
  414. pageAmt = (Slot - 7) / 9 + 3;
  415. }
  416. for (int i = 0; i < pageAmt; i++)
  417. {
  418. ManaGarden.CreatePage();
  419. }
  420. for (int i = 0; i < ManaGarden.SlotList.Count; i++)
  421. {
  422. if (i < Slot)
  423. {
  424. ManaGarden.SlotList[i].Lock = true;
  425. ManaGarden.SlotList[i].Available = true;
  426. }
  427. else
  428. {
  429. ManaGarden.SlotList[i].Lock = false;
  430. ManaGarden.SlotList[i].Available = false;
  431. }
  432. }
  433. List<KV<int, int>> plantList = ManaData.GetPlantList(Node);
  434. for (int i = 0; i < plantList.Count; i++)
  435. {
  436. ManaGarden.PlantFlower(plantList[i].Key, plantList[i].Value);
  437. }
  438. #endregion
  439. #region Player
  440. ManaReso.Save(ManaPlayer.Player);
  441. ManaReso.TraDic.Remove("Player");
  442. ManaPlayer.Instance.GetPlayer(Node).SetAllCollider(false);
  443. Garden.PlayerPos = new List<Vector3>();
  444. Garden.Player = ManaReso.Get("Player");
  445. Garden.PlayerPos.Add(ManaPlayer.Player.ChildDic["Pos1"].position);
  446. Garden.PlayerPos.Add(ManaPlayer.Player.ChildDic["Pos2"].position);
  447. #endregion
  448. #region Award
  449. if (ManaTutorial.TutorialC || Random.Range(0f,1f) <= AwardRate)
  450. {
  451. if (ManaTutorial.TutorialC)
  452. {
  453. ManaTutorial.EndC();
  454. }
  455. if (ManaGarden.PlantList.Count > 0)
  456. {
  457. ManaGarden.PlantList.Random()[0].Flower.Award = true;
  458. }
  459. }
  460. #endregion
  461. InVisit = true;
  462. }
  463. public static void UpdateCost()
  464. {
  465. if (Complete)
  466. {
  467. Cost = Mathf.FloorToInt((float)Auxiliary.FmlParse(CostFml, "l", ManaCenter.Level.ToString()));
  468. }
  469. }
  470. public static void DataReverse()
  471. {
  472. if (InVisit)
  473. {
  474. VisitPlantList = new List<Slot>(ManaGarden.PlantList);
  475. ManaGarden.PlantList = OriginPlantList;
  476. }
  477. }
  478. public static void DataRecover()
  479. {
  480. if (InVisit)
  481. {
  482. ManaGarden.PlantList = VisitPlantList;
  483. }
  484. }
  485. public static void ShowTip()
  486. {
  487. ManaReso.SetActive ("C_Tip", true);
  488. ManaReso.Get<Text> ("C_TipLab").text = Language.GetStr ("Tip", "Tip" + Random.Range(1,10));
  489. }
  490. public static void HideTip()
  491. {
  492. ManaReso.SetActive ("C_Tip", false);
  493. }
  494. public static void GetArchive()
  495. {
  496. if (Random.Range(0f, 1f) <= CreateRate)
  497. {
  498. LoadComplete = true;
  499. XmlStr = WriteArchive();
  500. Enter();
  501. }
  502. else
  503. {
  504. ManaServer.RandomLoad
  505. (
  506. (jsonData) =>
  507. {
  508. LoadComplete = true;
  509. if (jsonData.Inst_Object.ContainsKey("l"))
  510. {
  511. XmlStr = jsonData["l"].ToString();
  512. }
  513. else
  514. {
  515. LoadComplete = true;
  516. XmlStr = WriteArchive();
  517. }
  518. Enter();
  519. }
  520. );
  521. }
  522. }
  523. public static string WriteArchive()
  524. {
  525. XmlDocument doc = new XmlDocument();
  526. doc.LoadXml(ManaData.PlayerDoc.OuterXml);
  527. bool fancy;
  528. if (Random.Range(0f, 1f) < FancyRate)
  529. {
  530. fancy = true;
  531. }
  532. else
  533. {
  534. fancy = false;
  535. }
  536. int slot = 1;
  537. int newLevel = Random.Range(1, 301);
  538. XmlNodeList nodeList = doc.SelectSingleNode("PlayerConfig").SelectSingleNode("SkillList").ChildNodes;
  539. for (int i = 0; i < nodeList.Count; i++)
  540. {
  541. SkillType type = nodeList[i].Attributes[1].Value.ToEnum<SkillType>();
  542. if (type == SkillType.Ability)
  543. {
  544. Ability ability = (Ability) ManaCenter.SkillDic[nodeList[i].Attributes[0].Value];
  545. int unlockLevel = ability.UnlockLv;
  546. if (newLevel >= unlockLevel)
  547. {
  548. if (ability.ID_ >= 6)
  549. {
  550. slot++;
  551. }
  552. nodeList[i].Attributes[2].Value = "Upgrade";
  553. nodeList[i].Attributes[3].Value = newLevel.ToString();
  554. }
  555. else
  556. {
  557. nodeList[i].Attributes[2].Value = "Lock";
  558. nodeList[i].Attributes[3].Value = "0";
  559. }
  560. }
  561. }
  562. List<int> flowerList = new List<int>();
  563. for (int i = 2; i < 28; i++)
  564. {
  565. flowerList.Add(i);
  566. }
  567. int slotIndex = 0;
  568. string plantList = "";
  569. for (int i = 0; i < slot; i++)
  570. {
  571. if (fancy || Random.Range(0f, 1f) >= 0.35f)
  572. {
  573. int flowerID = slotIndex + 1;
  574. plantList += string.Format("{0},{1} ", flowerID, slotIndex);
  575. slotIndex++;
  576. }
  577. }
  578. plantList = plantList.TrimEnd(' ');
  579. doc.SelectSingleNode("PlayerConfig").SelectSingleNode("PlantList").Attributes[0].Value = plantList;
  580. XmlNode xmlNode = doc.SelectSingleNode("PlayerConfig").SelectSingleNode("DressData");
  581. xmlNode.Attributes[0].Value = "";
  582. xmlNode.Attributes[0].Value = ManaPlayer.CloseUnitDic[Random.Range(2, (int) Mathf.Lerp(2, 30, newLevel/300f)+1)].ArmatureName;
  583. xmlNode.Attributes[1].Value = ManaPlayer.CloseUnitDic[Random.Range(201, (int) Mathf.Lerp(201, 217, newLevel/300f)+1)].ArmatureName;
  584. xmlNode.Attributes[2].Value = ManaPlayer.CloseUnitDic[Random.Range(401, (int) Mathf.Lerp(401, 415, newLevel/300f)+1)].ArmatureName;
  585. xmlNode.Attributes[3].Value = ManaPlayer.CloseUnitDic[Random.Range(601, (int) Mathf.Lerp(601, 612, newLevel/300f)+1)].ArmatureName;
  586. xmlNode.Attributes[4].Value = ManaPlayer.CloseUnitDic[Random.Range(801, (int) Mathf.Lerp(801, 817, newLevel/300f)+1)].ArmatureName;
  587. xmlNode.Attributes[7].Value = ManaPlayer.CloseUnitDic[Random.Range(1001, (int) Mathf.Lerp(1001, 1003, newLevel/300f)+1)].ArmatureName;
  588. float eyeMouseRate = Random.Range(0f, 1f);
  589. if (eyeMouseRate <= 0.33f)
  590. {
  591. xmlNode.Attributes[5].Value = "眼睛1";
  592. xmlNode.Attributes[6].Value = "嘴巴1";
  593. }
  594. else if (eyeMouseRate <= 0.66f)
  595. {
  596. xmlNode.Attributes[5].Value = "眼睛2";
  597. xmlNode.Attributes[6].Value = "嘴巴2";
  598. }
  599. else
  600. {
  601. xmlNode.Attributes[5].Value = "眼睛3";
  602. xmlNode.Attributes[6].Value = "嘴巴3";
  603. }
  604. return doc.OuterXml;
  605. }
  606. }