XHDDLayer.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610
  1. using DG.Tweening;
  2. using System;
  3. using System.Collections;
  4. using System.Collections.Generic;
  5. using System.Threading.Tasks;
  6. using UnityAsync;
  7. //using UnityEditor.VersionControl;
  8. using UnityEngine;
  9. using UnityEngine.UI;
  10. using WaitUntil = UnityAsync.WaitUntil;
  11. [System.Serializable]
  12. public enum YJType
  13. {
  14. YELLOW,
  15. ORANGE,
  16. RED
  17. }
  18. [Serializable]
  19. public class SchedulingPlan
  20. {
  21. public float max_water_level;
  22. public string max_water_level_unit;
  23. public string max_water_level_time;
  24. public float flood_peak_flow_rate;
  25. public string flood_peak_flow_rate_unit;
  26. public float intercepted_flood_volume;
  27. public string intercepted_flood_volume_unit;
  28. public int peak_reduction_rate;
  29. public float final_water_level;
  30. public string final_water_level_unit;
  31. }
  32. [Serializable]
  33. public class SchedulingResults
  34. {
  35. public float inflow_peak;
  36. public string inflow_peak_unit;
  37. public float outflow_total;
  38. public string outflow_total_unit;
  39. public float initial_water_level;
  40. public string initial_water_level_unit;
  41. public float target_water_level;
  42. public string target_water_level_unit;
  43. }
  44. [Serializable]
  45. public class RiskInformation
  46. {
  47. public string warning_level;
  48. public float submerged_area;
  49. public string submerged_area_unit;
  50. public float submerged_farmland_area;
  51. public string submerged_farmland_area_unit;
  52. public float affected_population;
  53. public string affected_population_unit;
  54. public float submerged_area_gdp;
  55. public string submerged_area_gdp_unit;
  56. public float flood_loss;
  57. public string flood_loss_unit;
  58. }
  59. [Serializable]
  60. public class PersonnelSupport
  61. {
  62. public int id;
  63. public string person;
  64. public string unit;
  65. public string position;
  66. public string phone;
  67. }
  68. [Serializable]
  69. public class MaterialSupport
  70. {
  71. public int id;
  72. public string type;
  73. public int quantity;
  74. public string unit;
  75. public string person_in_charge;
  76. public string region;
  77. }
  78. [Serializable]
  79. public class Data
  80. {
  81. public SchedulingPlan scheduling_plan;
  82. public SchedulingResults scheduling_results;
  83. public RiskInformation risk_information;
  84. public List<PersonnelSupport> personnel_support;
  85. public List<MaterialSupport> material_support;
  86. }
  87. [Serializable]
  88. public class SchedulingData
  89. {
  90. public int id;
  91. public string scheduling_name;
  92. public Data data;
  93. }
  94. public class XHDDLayer : YZTRootLayer
  95. {
  96. public RectTransform qxhddContent;
  97. public RectTransform xhddContent;
  98. public Button enterBtn;
  99. public Button exitBtn;
  100. public Button playBtn;
  101. public List<Text> threeStepBtns = new List<Text>();
  102. public Dropdown yjDropdown;
  103. public Button[] yjButtons;
  104. public YJType yJType;
  105. public string[,] allYAContent = new string[3, 3];
  106. public bool playing = false;
  107. float currentTime = 0;
  108. [Header("UpLeft")]
  109. public Text ddNameText;
  110. public Text zuigaoshuiweiText;
  111. public Text zuigaoshuiweishijianText;
  112. public Text hongfengliusuText;
  113. public Text lanxuhongliangText;
  114. public Text xuefenglvText;
  115. public Text moqishuiweiText;
  116. [Header("MiddleLeft")]
  117. public Text rukuhongfengText;
  118. public Text qitiaoshuiweiText;
  119. public Text chukuzongliuliangText;
  120. public Text mubiaoshuiweiText;
  121. [Header("DownLeft")]
  122. public RectTransform rkzyContent;
  123. public GameObject rkzyPrefab;
  124. [Header("UpRight")]
  125. public Text fengxiandengjiText;
  126. public Text yanmomianjiText;
  127. public Text yanmogengdiText;
  128. public Text yingxiangrenkouText;
  129. public Text gDPText;
  130. public Text hongshuisunshiText;
  131. [Header("MiddleRight")]
  132. public RectTransform rybzContent;
  133. public GameObject rybzPrefab;
  134. [Header("DownRight")]
  135. public RectTransform wzbzContent;
  136. public GameObject wzbzPrefab;
  137. [Header("损失概况")]
  138. public GameObject SunShiGaiKuangPanel;
  139. public Text yanMoMianJiText;
  140. public Text yanMoGengDiText;
  141. public Text yanMoRenKouText;
  142. public Text sunShiCaiChanText;
  143. public GameObject sunShiLieBiaoPrefab;
  144. public Transform sunShiLieBiaoContent;
  145. public GameObject mask;
  146. // Start is called before the first frame update
  147. void Start()
  148. {
  149. InitYAContent();
  150. InitButton();
  151. InitUpLeft();
  152. InitMiddleLeft();
  153. InitDownLeft();
  154. InitUpRight();
  155. InitMiddleRight();
  156. InitDownRight();
  157. }
  158. private void OnEnable()
  159. {
  160. CameraManager.SwitchCamera(0);
  161. StaticLod.instance.OnFoucusStatic(1);
  162. TimeLineControl.instance.transform.GetChild(1).GetChild(0).gameObject.SetActive(true);
  163. TimeLineControl.instance.transform.GetChild(1).GetChild(1).gameObject.SetActive(true);
  164. GameObject.FindGameObjectWithTag("HeMianStatic").transform.GetChild(2).gameObject.SetActive(false);
  165. }
  166. private void InitUpLeft()
  167. {
  168. ddNameText.text = GlobalData.schedulingData.scheduling_name;
  169. zuigaoshuiweiText.text = $"{GlobalData.schedulingData.data.scheduling_plan.max_water_level} <size=12><color=#A5BBE2>m</color></size>";
  170. zuigaoshuiweishijianText.text = $"{GlobalData.schedulingData.data.scheduling_plan.max_water_level_time}";
  171. hongfengliusuText.text = $"{GlobalData.schedulingData.data.scheduling_plan.flood_peak_flow_rate} <size=12><color=#A5BBE2>m³/s</color></size>";
  172. lanxuhongliangText.text = $"{GlobalData.schedulingData.data.scheduling_plan.intercepted_flood_volume} <size=12><color=#A5BBE2>m³/s</color></size>";
  173. xuefenglvText.text = $"{GlobalData.schedulingData.data.scheduling_plan.peak_reduction_rate} <size=12><color=#A5BBE2>%</color></size>";
  174. moqishuiweiText.text = $"{GlobalData.schedulingData.data.scheduling_plan.final_water_level} <size=12><color=#A5BBE2>m</color></size>";
  175. }
  176. private void InitMiddleLeft()
  177. {
  178. rukuhongfengText.text = $"{GlobalData.schedulingData.data.scheduling_results.inflow_peak} <size=14><color=#A5BBE2>m³/s</color></size>";
  179. qitiaoshuiweiText.text = $"{GlobalData.schedulingData.data.scheduling_results.outflow_total} <size=14><color=#A5BBE2>m</color></size>";
  180. chukuzongliuliangText.text = $"{GlobalData.schedulingData.data.scheduling_results.initial_water_level} <size=14><color=#A5BBE2>m³/s</color></size>";
  181. mubiaoshuiweiText.text = $"{GlobalData.schedulingData.data.scheduling_results.target_water_level} <size=14><color=#A5BBE2>m</color></size>";
  182. }
  183. private async Task InitDownLeft()
  184. {
  185. await new WaitUntil(() =>
  186. {
  187. return GlobalData.allServerMovePlans.Count > 0;
  188. });
  189. for (int i = 0; i < GlobalData.allServerMovePlans.Count; i++)
  190. {
  191. GameObject obj = Instantiate(rkzyPrefab);
  192. obj.transform.SetParent(rkzyContent);
  193. obj.transform.localScale = Vector3.one;
  194. obj.transform.GetChild(0).GetComponent<Text>().text = i.ToString();
  195. obj.transform.GetChild(1).GetComponent<Text>().text = GlobalData.allServerMovePlans[i].from;
  196. obj.transform.GetChild(2).GetComponent<Text>().text = GlobalData.allServerMovePlans[i].to;
  197. obj.transform.GetChild(3).GetComponent<Text>().text = CoordinateConverter.Haversine(GlobalData.allServerMovePlans[i].fromLttd, GlobalData.allServerMovePlans[i].fromLong, GlobalData.allServerMovePlans[i].toLttd, GlobalData.allServerMovePlans[i].toLong).ToString("0.00") + "km";
  198. obj.transform.GetChild(4).GetComponent<Text>().text = GlobalData.allServerMovePlans[i].manNum.ToString();
  199. }
  200. }
  201. private void InitUpRight()
  202. {
  203. fengxiandengjiText.text = $"{GlobalData.schedulingData.data.risk_information.warning_level} <size=14><color=#A5BFE2>级</color></size>";
  204. yanmomianjiText.text = $"{GlobalData.schedulingData.data.risk_information.submerged_area} <size=14><color=#A5BFE2>k㎡</color></size>";
  205. yanmogengdiText.text = $"{GlobalData.schedulingData.data.risk_information.submerged_farmland_area} <size=14><color=#A5BFE2>h㎡</color></size>";
  206. yingxiangrenkouText.text = $"{GlobalData.schedulingData.data.risk_information.affected_population} <size=14><color=#A5BFE2>万人</color></size>";
  207. gDPText.text = $"{GlobalData.schedulingData.data.risk_information.submerged_area_gdp} <size=14><color=#A5BFE2>亿元</color></size>";
  208. hongshuisunshiText.text = $"{GlobalData.schedulingData.data.risk_information.flood_loss} <size=14><color=#A5BFE2>亿元</color></size>";
  209. }
  210. private void InitMiddleRight()
  211. {
  212. for (int i = 0; i < GlobalData.schedulingData.data.personnel_support.Count; i++)
  213. {
  214. GameObject obj = Instantiate(rybzPrefab);
  215. obj.transform.SetParent(rybzContent);
  216. obj.transform.localScale = Vector3.one;
  217. obj.transform.GetChild(0).GetComponent<Text>().text = GlobalData.schedulingData.data.personnel_support[i].id.ToString();
  218. obj.transform.GetChild(1).GetComponent<Text>().text = GlobalData.schedulingData.data.personnel_support[i].person;
  219. obj.transform.GetChild(2).GetComponent<Text>().text = GlobalData.schedulingData.data.personnel_support[i].unit;
  220. obj.transform.GetChild(3).GetComponent<Text>().text = GlobalData.schedulingData.data.personnel_support[i].position.ToString();
  221. obj.transform.GetChild(4).GetComponent<Text>().text = GlobalData.schedulingData.data.personnel_support[i].phone.ToString();
  222. }
  223. }
  224. private void InitDownRight()
  225. {
  226. for (int i = 0; i < GlobalData.schedulingData.data.material_support.Count; i++)
  227. {
  228. GameObject obj = Instantiate(wzbzPrefab);
  229. obj.transform.SetParent(wzbzContent);
  230. obj.transform.localScale = Vector3.one;
  231. obj.transform.GetChild(0).GetComponent<Text>().text = GlobalData.schedulingData.data.material_support[i].id.ToString();
  232. obj.transform.GetChild(1).GetComponent<Text>().text = GlobalData.schedulingData.data.material_support[i].type;
  233. obj.transform.GetChild(2).GetComponent<Text>().text = GlobalData.schedulingData.data.material_support[i].quantity.ToString() + GlobalData.schedulingData.data.material_support[i].unit.ToString();
  234. obj.transform.GetChild(3).GetComponent<Text>().text = GlobalData.schedulingData.data.material_support[i].unit.ToString();
  235. obj.transform.GetChild(4).GetComponent<Text>().text = GlobalData.schedulingData.data.material_support[i].person_in_charge.ToString();
  236. obj.transform.GetChild(5).GetComponent<Text>().text = GlobalData.schedulingData.data.material_support[i].region.ToString();
  237. }
  238. }
  239. public override void OnUILeave()
  240. {
  241. base.OnUILeave();
  242. OnExitXHDDYS();
  243. }
  244. void InitYAContent()
  245. {
  246. allYAContent[0, 0] = "当预报洪水将达到或超过蓄滞洪区启用标准时(套口进洪闸的设防水位为32m),发布黄色预警,做好运用准备。";
  247. allYAContent[0, 1] = "分洪前线指挥部及其下设七个责任组责任人和成员迅速进入运用准备状态,服从前指的统一调度。";
  248. allYAContent[0, 2] = "分蓄洪区内各个乡镇、村组确定1名领导专门负责承担警报发布和传递任务。警报一经发布,各项避洪工作必须迅速及时,不得有误。";
  249. allYAContent[1, 0] = "当需要区内人员转移时,发布橙色预警,开始实施分蓄洪区内居民转移、清场等工作。";
  250. allYAContent[1, 1] = "人员转移时机根据荆江河段及城陵矶附近地区实时水情、防洪工程情况和区内人员转移所需时间等确定。";
  251. allYAContent[1, 2] = "采取电视、广播、电话、传真、汽笛、敲锣、挂旗、报警器、鸣枪或挨户通知等一切可能的形式迅速向分洪区传播分洪转移命令。";
  252. allYAContent[2, 0] = "当决定启用蓄滞洪区时,发布红色警报。";
  253. allYAContent[2, 1] = "开启套口进洪闸或实施上车湾口门爆破,开始分蓄洪。";
  254. allYAContent[2, 2] = "红色警报期持续至具备返迁条件时为止。";
  255. }
  256. void OnExitXHDDYS()
  257. {
  258. qxhddContent.gameObject.SetActive(true);
  259. xhddContent.gameObject.SetActive(false);
  260. playBtn.interactable = true;
  261. playBtn.GetComponentInChildren<Text>().text = "开始演示";
  262. mask.gameObject.SetActive(false);
  263. playing = false;
  264. AllRestore();
  265. }
  266. void InitButton()
  267. {
  268. enterBtn.onClick.AddListener(() =>
  269. {
  270. qxhddContent.gameObject.SetActive(false);
  271. xhddContent.gameObject.SetActive(true);
  272. });
  273. exitBtn.onClick.AddListener(OnExitXHDDYS);
  274. for (int i = 0; i < yjButtons.Length; i++)
  275. {
  276. int temp = i;
  277. yjButtons[i].onClick.AddListener(() =>
  278. {
  279. if (!playing)
  280. {
  281. ClearAllText();
  282. }
  283. for (int j = 0; j < yjButtons.Length; j++)
  284. {
  285. yjButtons[j].GetComponent<CanvasGroup>().alpha = 0.2f;
  286. }
  287. yjButtons[temp].GetComponent<CanvasGroup>().alpha = 1f;
  288. yJType = (YJType)temp;
  289. yjDropdown.value = temp;
  290. });
  291. }
  292. yjDropdown.onValueChanged.AddListener((int value) =>
  293. {
  294. if (!playing)
  295. {
  296. ClearAllText();
  297. }
  298. for (int j = 0; j < yjButtons.Length; j++)
  299. {
  300. yjButtons[j].GetComponent<CanvasGroup>().alpha = 0.2f;
  301. }
  302. yjButtons[value].GetComponent<CanvasGroup>().alpha = 1f;
  303. yJType = (YJType)value;
  304. });
  305. playBtn.onClick.AddListener(() =>
  306. {
  307. ClearAllText();
  308. playing = true;
  309. playBtn.interactable = false;
  310. playBtn.GetComponentInChildren<Text>().text = "演示中...";
  311. mask.gameObject.SetActive(true);
  312. currentTime = 0;
  313. ControlYJ();
  314. });
  315. }
  316. void AllRestore()
  317. {
  318. TimeLineControl.instance.transform.GetChild(1).GetChild(1).localPosition = Vector3.zero;
  319. TimeLineControl.instance.transform.GetChild(0).gameObject.SetActive(false);
  320. TimeLineControl.instance.transform.GetChild(2).GetChild(0).gameObject.SetActive(false);
  321. GameObject.FindGameObjectWithTag("HeMianStatic").transform.GetChild(2).gameObject.SetActive(true);
  322. Material material = TimeLineControl.instance.transform.GetChild(1).GetChild(0).GetComponent<MeshRenderer>().material;
  323. ClearAllText();
  324. material.SetFloat("_ClipLength", 1);
  325. currentTime = 0;
  326. }
  327. void ClearAllText()
  328. {
  329. for (int i = 0; i < threeStepBtns.Count; i++)
  330. {
  331. threeStepBtns[i].text = "";
  332. }
  333. }
  334. async void ControlYJ()
  335. {
  336. switch (yJType)
  337. {
  338. case YJType.YELLOW:
  339. TimeLineControl.instance.transform.GetChild(1).GetChild(1).localPosition = Vector3.zero;
  340. threeStepBtns[0].text = allYAContent[(int)yJType, 0];
  341. await new WaitUntil(() =>
  342. {
  343. return currentTime > 1;
  344. });
  345. if (!playing)
  346. {
  347. playBtn.interactable = true;
  348. playBtn.GetComponentInChildren<Text>().text = "开始演示";
  349. mask.gameObject.SetActive(false);
  350. return;
  351. }
  352. StaticLod.instance.OnFoucusStatic("Bird1");
  353. await new WaitUntil(() =>
  354. {
  355. return currentTime > 3;
  356. });
  357. if (!playing)
  358. {
  359. playBtn.interactable = true;
  360. playBtn.GetComponentInChildren<Text>().text = "开始演示";
  361. mask.gameObject.SetActive(false);
  362. return;
  363. }
  364. TimeLineControl.instance.transform.GetChild(1).GetChild(1).DOLocalMove(new Vector3(0, 0, 31.2f), 12.0f);
  365. await new WaitUntil(() =>
  366. {
  367. return currentTime > 14;
  368. });
  369. if (!playing)
  370. {
  371. playBtn.interactable = true;
  372. playBtn.GetComponentInChildren<Text>().text = "开始演示";
  373. mask.gameObject.SetActive(false);
  374. return;
  375. }
  376. threeStepBtns[1].text = allYAContent[(int)yJType, 1];
  377. StaticLod.instance.OnFoucusStatic("Bird2");
  378. await new WaitUntil(() =>
  379. {
  380. return currentTime > 17;
  381. });
  382. if (!playing)
  383. {
  384. playBtn.interactable = true;
  385. playBtn.GetComponentInChildren<Text>().text = "开始演示";
  386. mask.gameObject.SetActive(false);
  387. return;
  388. }
  389. threeStepBtns[2].text = allYAContent[(int)yJType, 2];
  390. playBtn.interactable = true;
  391. playBtn.GetComponentInChildren<Text>().text = "开始演示";
  392. mask.gameObject.SetActive(false);
  393. break;
  394. case YJType.ORANGE:
  395. TimeLineControl.instance.transform.GetChild(1).GetChild(1).localPosition = new Vector3(0, 0, 31.2f);
  396. TimeLineControl.instance.transform.GetChild(0).gameObject.SetActive(false);
  397. threeStepBtns[0].text = allYAContent[(int)yJType, 0];
  398. await new WaitUntil(() =>
  399. {
  400. return currentTime > 1;
  401. });
  402. if (!playing)
  403. {
  404. playBtn.interactable = true;
  405. playBtn.GetComponentInChildren<Text>().text = "开始演示";
  406. mask.gameObject.SetActive(false);
  407. return;
  408. }
  409. StaticLod.instance.OnFoucusStatic("Bird3");
  410. await new WaitUntil(() =>
  411. {
  412. return currentTime > 3;
  413. });
  414. if (!playing)
  415. {
  416. playBtn.interactable = true;
  417. playBtn.GetComponentInChildren<Text>().text = "开始演示";
  418. mask.gameObject.SetActive(false);
  419. return;
  420. }
  421. TimeLineControl.instance.transform.GetChild(0).gameObject.SetActive(true);
  422. await new WaitUntil(() =>
  423. {
  424. return currentTime > 11;
  425. });
  426. if (!playing)
  427. {
  428. playBtn.interactable = true;
  429. playBtn.GetComponentInChildren<Text>().text = "开始演示";
  430. mask.gameObject.SetActive(false);
  431. return;
  432. }
  433. threeStepBtns[1].text = allYAContent[(int)yJType, 1];
  434. //StaticLod.instance.OnFoucusStatic("Bird3");
  435. await new WaitUntil(() =>
  436. {
  437. return currentTime > 14;
  438. });
  439. if (!playing)
  440. {
  441. playBtn.interactable = true;
  442. playBtn.GetComponentInChildren<Text>().text = "开始演示";
  443. mask.gameObject.SetActive(false);
  444. return;
  445. }
  446. threeStepBtns[2].text = allYAContent[(int)yJType, 2];
  447. playBtn.interactable = true;
  448. playBtn.GetComponentInChildren<Text>().text = "开始演示";
  449. mask.gameObject.SetActive(false);
  450. break;
  451. case YJType.RED:
  452. Material material = TimeLineControl.instance.transform.GetChild(1).GetChild(0).GetComponent<MeshRenderer>().material;
  453. TimeLineControl.instance.transform.GetChild(0).gameObject.SetActive(false);
  454. material.SetFloat("_ClipLength", 1);
  455. TimeLineControl.instance.transform.GetChild(1).GetChild(1).localPosition = new Vector3(0, 0, 31.2f);
  456. TimeLineControl.instance.transform.GetChild(2).GetChild(0).gameObject.SetActive(false);
  457. threeStepBtns[0].text = allYAContent[(int)yJType, 0];
  458. await new WaitUntil(() =>
  459. {
  460. return currentTime > 1;
  461. });
  462. if (!playing)
  463. {
  464. playBtn.interactable = true;
  465. playBtn.GetComponentInChildren<Text>().text = "开始演示";
  466. mask.gameObject.SetActive(false);
  467. return;
  468. }
  469. StaticLod.instance.OnFoucusStatic("Bird2");
  470. await new WaitUntil(() =>
  471. {
  472. return currentTime > 4;
  473. });
  474. if (!playing)
  475. {
  476. playBtn.interactable = true;
  477. playBtn.GetComponentInChildren<Text>().text = "开始演示";
  478. mask.gameObject.SetActive(false);
  479. return;
  480. }
  481. StaticLod.instance.OnFoucusStatic("Bird4");
  482. //ActionInstance._Instance.ModelAni_On?.Invoke(null);
  483. await new WaitUntil(() =>
  484. {
  485. return currentTime > 5.2;
  486. });
  487. TimeLineControl.instance.transform.GetChild(2).GetChild(0).gameObject.SetActive(true);
  488. if (!playing)
  489. {
  490. playBtn.interactable = true;
  491. playBtn.GetComponentInChildren<Text>().text = "开始演示";
  492. mask.gameObject.SetActive(false);
  493. return;
  494. }
  495. await new WaitUntil(() =>
  496. {
  497. return currentTime > 5.7;
  498. });
  499. material.SetFloat("_ClipLength", 0.981f);
  500. if (!playing)
  501. {
  502. playBtn.interactable = true;
  503. playBtn.GetComponentInChildren<Text>().text = "开始演示";
  504. mask.gameObject.SetActive(false);
  505. return;
  506. }
  507. threeStepBtns[1].text = allYAContent[(int)yJType, 1];
  508. await new WaitUntil(() =>
  509. {
  510. return currentTime > 7.7;
  511. });
  512. if (!playing)
  513. {
  514. playBtn.interactable = true;
  515. playBtn.GetComponentInChildren<Text>().text = "开始演示";
  516. mask.gameObject.SetActive(false);
  517. return;
  518. }
  519. StaticLod.instance.OnFoucusStatic("Bird5");
  520. DOTween.To(() => material.GetFloat("_ClipLength"), x => material.SetFloat("_ClipLength", x), 0.881f, 4f);
  521. await new WaitUntil(() =>
  522. {
  523. return currentTime > 12.7;
  524. });
  525. if (!playing)
  526. {
  527. playBtn.interactable = true;
  528. playBtn.GetComponentInChildren<Text>().text = "开始演示";
  529. mask.gameObject.SetActive(false);
  530. return;
  531. }
  532. StaticLod.instance.OnFoucusStatic("Bird3");
  533. DOTween.To(() => material.GetFloat("_ClipLength"), x => material.SetFloat("_ClipLength", x), 0.1f, 6f);
  534. await new WaitUntil(() =>
  535. {
  536. return currentTime > 18.7;
  537. });
  538. if (!playing)
  539. {
  540. playBtn.interactable = true;
  541. playBtn.GetComponentInChildren<Text>().text = "开始演示";
  542. mask.gameObject.SetActive(false);
  543. return;
  544. }
  545. threeStepBtns[2].text = allYAContent[(int)yJType, 2];
  546. playBtn.interactable = true;
  547. playBtn.GetComponentInChildren<Text>().text = "开始演示";
  548. mask.gameObject.SetActive(false);
  549. break;
  550. }
  551. }
  552. // Update is called once per frame
  553. void Update()
  554. {
  555. currentTime += Time.deltaTime;
  556. }
  557. }