XHDDLayer.cs 25 KB

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