Scenes_YiLiao.cs 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729
  1. using CCS.App;
  2. using DG.Tweening;
  3. using SC.XR.Unity;
  4. using System;
  5. using System.Collections;
  6. using System.Collections.Generic;
  7. using System.Linq;
  8. using System.Timers;
  9. using TMPro;
  10. using UnityEngine;
  11. public class Scenes_YiLiao : MonoBehaviour
  12. {
  13. // Start is called before the first frame update
  14. public string SeverString;
  15. public GameObject bodyRol;
  16. public GameObject muscle;
  17. /// <summary>
  18. /// 初始效果出现隐藏变量
  19. /// </summary>
  20. public MeshRenderer startRentiRenderer;
  21. private float initStartRentiRendererFloat;
  22. private float maxStartRentiRendererFloat;
  23. private float minStartRentiRendererFloat;
  24. private bool _isStartShow;
  25. public GameObject[] topTextsList;
  26. public GameObject[] topSlidesList;
  27. private float initTopTxtsTxtColorA;
  28. private float maxTopTxtsTxtColorA;
  29. private float minTopTxtsTxtColorA;
  30. private float inittopSlidesColorRGB;
  31. private float maxtopSlidesColorRGB;
  32. private float mintopSlidesColorRGB;
  33. /// <summary>
  34. /// 头部变量
  35. /// </summary>
  36. public MeshRenderer babyTopRenderer;
  37. public SCSlider3D babyTopSlider;
  38. //头部滑块变量
  39. public MeshRenderer babyTopSaoMaoFXRenderer;
  40. private Color initBabyTopSaoMaoFXRendererColor;
  41. private Animator anim_babyTopSaoMaoFX;
  42. private bool isbabyTopSaoMaoFXShowOrHeid;
  43. private bool IsOneOpenBabyTopSaoMaoFXShowOrHeid;
  44. /// <summary>
  45. /// 身体躯干变量
  46. /// </summary>
  47. public MeshRenderer babyTrunkRenderer;
  48. public SCSlider3D babyTrunkSlider;
  49. //头部ct变量
  50. public MeshRenderer ct1Renderer;
  51. private float initBabyTrunRongjie;
  52. private float MaxBabyTrunRongjie;
  53. private float minBabyTrunRongjie;
  54. private bool isUserDownBabyTrunkSlider;
  55. public GameObject[] babyTrunkGamesUIList;
  56. private FunctionInfo _headFunction;
  57. private FunctionInfo _bodyFunction;
  58. private float _waitTime = 3;
  59. public bool IsStartShow
  60. {
  61. set
  62. {
  63. _isStartShow = value;
  64. StartCoroutine(Ro3Show(_isStartShow));
  65. if (value)
  66. {
  67. }
  68. else
  69. {
  70. // ShowOrHeidBbabyTrunkUI(-1, babyTrunkGamesUIList, "r1");
  71. babyTopSlider.value = _headFunction == null ? 0 : _headFunction.defaultValue / 1.0f;
  72. babyTrunkSlider.value = _bodyFunction == null ? 0 : _bodyFunction.defaultValue / 1.0f;
  73. //scannerSlider.value=
  74. babyTopRenderer.material.SetFloat("_Ani", 0);
  75. }
  76. }
  77. }
  78. #region 新的整体滑动条逻辑
  79. /// <summary>
  80. /// 新的整体滑动条
  81. /// </summary>
  82. public SCSlider3D scannerSlider;
  83. public GameObject hintHandGo; //小手
  84. public float fixedpoint_startvalue;//固定的头和身体的中间值开始变量
  85. public float fixedpoint_endvalue;//固定的头和身体的中间值结束变量
  86. private float now_value; //当前value
  87. private float top_value; //滑到头部时value
  88. private float baby_value;//滑到身体时的value
  89. public GameObject RayLiget;
  90. /// <summary>
  91. /// 扫描仪拖动事件
  92. /// </summary>
  93. public void ScannerSliderValueChaged()
  94. {
  95. now_value = scannerSlider.value;
  96. if (now_value <= fixedpoint_startvalue)
  97. {
  98. isTop = true;
  99. babyTrunkGamesUIList[0].SetActive(false);
  100. babyTrunkRenderer.material.SetFloat("_rongjie", 1);
  101. top_value = now_value / fixedpoint_startvalue;
  102. babyTopRenderer.material.SetFloat("_Ani", top_value);
  103. }
  104. else if(now_value >= fixedpoint_endvalue)
  105. {
  106. isTop = false;
  107. babyTrunkGamesUIList[0].SetActive(true);
  108. baby_value = (now_value- fixedpoint_endvalue) / (1 - fixedpoint_endvalue);
  109. if(baby_value>=1)
  110. {
  111. baby_value = 1;
  112. }
  113. babyTrunkRenderer.material.SetFloat("_rongjie", 0);
  114. babyTrunkRenderer.material.SetFloat("_Ani", baby_value);
  115. if (baby_value <= 0.1f)
  116. {
  117. ShowOrHeidBbabyTrunkUI(0, babyTrunkGamesUIList, "r4");
  118. }
  119. else if (baby_value >= 0.1f && baby_value < 0.3f)
  120. {
  121. ShowOrHeidBbabyTrunkUI(1, babyTrunkGamesUIList, "r3");
  122. }
  123. else if (baby_value >= 0.3f && baby_value < 0.5f)
  124. {
  125. ShowOrHeidBbabyTrunkUI(2, babyTrunkGamesUIList, "r2");
  126. }
  127. else if (baby_value >= 0.5f && baby_value < 1f)
  128. {
  129. ShowOrHeidBbabyTrunkUI(3, babyTrunkGamesUIList, "r1");
  130. }
  131. }
  132. }
  133. public bool isTop = true; //是否扫描的头部
  134. /// <summary>
  135. /// 进入或者滑出滑动条进行的操作
  136. /// </summary>
  137. /// <param name="str"></param>
  138. public void Show_ScannerSliderFX(string str)
  139. {
  140. if (str == "Down")
  141. {
  142. RayLiget.SetActive(true);
  143. if (isTop)
  144. {
  145. babyTopSaoMaoFXRenderer.gameObject.SetActive(true);
  146. anim_babyTopSaoMaoFX.Play("startSaoMiao");
  147. // SendTopFenctionInfo2S(top_value);
  148. }
  149. else
  150. {
  151. isUserDownBabyTrunkSlider = true;
  152. // SendBabyFenctionInfo2S(baby_value);
  153. }
  154. muscle.SetActive(true);
  155. }
  156. if (str == "Up")
  157. {
  158. RayLiget.SetActive(false);
  159. if (isTop)
  160. {
  161. anim_babyTopSaoMaoFX.Play("retrunSaoMiao");
  162. // SendTopFenctionInfo2S(top_value);
  163. }
  164. else
  165. {
  166. isUserDownBabyTrunkSlider = false;
  167. // SendBabyFenctionInfo2S(baby_value);
  168. }
  169. }
  170. ShowOrHeidTextsColorA("ChangeTextMeshPro", topTextsList, initTopTxtsTxtColorA, true);
  171. }
  172. /// <summary>
  173. /// 焦点进入事件
  174. /// </summary>
  175. public void PointEnterEvent()
  176. {
  177. Debug.Log("PointEnterEvent");
  178. hintHandGo.SetActive(true);
  179. }
  180. /// <summary>
  181. /// 焦点移出事件
  182. /// </summary>
  183. public void PointExitEvent()
  184. {
  185. Debug.Log("PointExitEvent");
  186. hintHandGo.SetActive(false);
  187. }
  188. /// <summary>
  189. /// 发送头当前数据给中控
  190. /// </summary>
  191. /// <param name="value">当前value</param>
  192. private void SendTopFenctionInfo2S(float value)
  193. {
  194. // _headFunction.functionValues[0].value = (int)(value * 100);
  195. // GameManager.Instance.SendFunctionInfo2S(_headFunction);
  196. }
  197. /// <summary>
  198. /// 发送身体当前数据给中控
  199. /// </summary>
  200. /// <param name="value">当前value</param>
  201. private void SendBabyFenctionInfo2S(float value)
  202. {
  203. // _bodyFunction.functionValues[0].value = (int)(value * 100);
  204. // GameManager.Instance.SendFunctionInfo2S(_bodyFunction);
  205. }
  206. /// <summary>
  207. /// 获取头或者身体当前滑动条的值
  208. /// </summary>
  209. /// <param name="value">中控发送的值</param>
  210. /// <param name="type">0 为头部, 1为身体</param>
  211. /// <returns>换算后的滑动条值</returns>
  212. private float ConvertsTheurrentSliderPosition(float value,int type)
  213. {
  214. if (type == 0)//扫描的头部
  215. {
  216. return (value * fixedpoint_startvalue);
  217. }
  218. else if (type == 1) //扫描的身体
  219. {
  220. return (value * (1 - fixedpoint_endvalue)+ fixedpoint_endvalue);
  221. }
  222. return 0;
  223. }
  224. #endregion
  225. private void Awake()
  226. {
  227. // GameManager.Instance.functionChangleAction += MedicalFunctionChangleHandler;
  228. // _headFunction = AppManager.Instance.functionInfos.FirstOrDefault(f => f.moduleID == 2 && f.functionID == 3);
  229. // _bodyFunction = AppManager.Instance.functionInfos.FirstOrDefault(f => f.moduleID == 2 && f.functionID == 4);
  230. }
  231. private void OnDestroy()
  232. {
  233. // GameManager.Instance.functionChangleAction -= MedicalFunctionChangleHandler;
  234. }
  235. private void MedicalFunctionChangleHandler(int moduleID, int functionID, FunctionType functionType, List<FunctionValue> functionValues)
  236. {
  237. //当前是医疗
  238. if (moduleID == 2 && functionID == 1 && functionType == FunctionType.Switch)
  239. {
  240. switch ((FunctionState)functionValues[0].value)
  241. {
  242. case FunctionState.None:
  243. break;
  244. case FunctionState.Open:
  245. StartOrOpenRenTiObj(true);
  246. break;
  247. case FunctionState.Close:
  248. StartOrOpenRenTiObj(false);
  249. break;
  250. case FunctionState.Wait:
  251. break;
  252. default:
  253. break;
  254. }
  255. }
  256. else if (moduleID == 2 && functionID == 3 && functionType == FunctionType.RangeValue)
  257. {
  258. babyTopSlider.value = functionValues[0].value / 100.0f;
  259. //metoo
  260. ; scannerSlider.value = ConvertsTheurrentSliderPosition(functionValues[0].value / 100.0f,0);
  261. }
  262. else if (moduleID == 2 && functionID == 4 && functionType == FunctionType.RangeValue)
  263. {
  264. if (!muscle.activeSelf)
  265. {
  266. muscle.SetActive(true);
  267. isUserDownBabyTrunkSlider = true;
  268. }
  269. babyTrunkSlider.value = functionValues[0].value / 100.0f;
  270. //metoo
  271. scannerSlider.value = ConvertsTheurrentSliderPosition(functionValues[0].value / 100.0f, 1);
  272. ScannerSliderValueChaged();
  273. BabyTrunkSliderValueChaged();
  274. _waitTime = 0;
  275. }
  276. }
  277. void Start()
  278. {
  279. Init();
  280. StartOrOpenRenTiObj(true);
  281. StartCoroutine(DeleEffectsTrue());
  282. }
  283. IEnumerator DeleEffectsTrue()
  284. {
  285. yield return new WaitForSeconds(0.1f);
  286. // GameManager.Instance.LoadingGameObj(false);
  287. }
  288. WaitForEndOfFrame wfs = new WaitForEndOfFrame();
  289. IEnumerator Ro3Show(bool isShow)
  290. {
  291. startRentiRenderer.gameObject.SetActive(true);
  292. if (isShow)
  293. {
  294. bodyRol.SetActive(true);
  295. }
  296. startRentiRenderer.material.SetFloat("_Float1", isShow ? maxStartRentiRendererFloat : minStartRentiRendererFloat);
  297. bool isStart = true;
  298. while (isStart)
  299. {
  300. yield return wfs;
  301. if (isShow)
  302. {
  303. if (initStartRentiRendererFloat < minStartRentiRendererFloat)
  304. {
  305. isStart = false;
  306. }
  307. }
  308. else
  309. {
  310. if (initStartRentiRendererFloat > maxStartRentiRendererFloat)
  311. {
  312. isStart = false;
  313. bodyRol.SetActive(false);
  314. }
  315. }
  316. }
  317. startRentiRenderer.gameObject.SetActive(false);
  318. }
  319. private void Init()
  320. {
  321. InitStartBabyAll();
  322. InitBabyTop();
  323. InitBabyTrunk();
  324. }
  325. /// <summary>
  326. /// 整体效果初始化
  327. /// </summary>
  328. private void InitStartBabyAll()
  329. {
  330. muscle.SetActive(false);
  331. initStartRentiRendererFloat = 1.2f;
  332. maxStartRentiRendererFloat = initStartRentiRendererFloat;
  333. minStartRentiRendererFloat = 0;
  334. startRentiRenderer.material.SetFloat("_Float1", initStartRentiRendererFloat);
  335. IsStartShow = false;
  336. initTopTxtsTxtColorA = 0;
  337. maxTopTxtsTxtColorA = 1;
  338. minTopTxtsTxtColorA = initTopTxtsTxtColorA;
  339. inittopSlidesColorRGB = 0;
  340. maxtopSlidesColorRGB = 1;
  341. mintopSlidesColorRGB = inittopSlidesColorRGB;
  342. }
  343. /// <summary>
  344. /// 脑部初始
  345. /// </summary>
  346. private void InitBabyTop()
  347. {
  348. babyTopRenderer.material.SetFloat("_Ani", 0);
  349. ct1Renderer.material.SetFloat("_Ani", 0);
  350. anim_babyTopSaoMaoFX = babyTopSaoMaoFXRenderer.gameObject.GetComponent<Animator>();
  351. initBabyTopSaoMaoFXRendererColor = new Color(0, 0, 0);
  352. babyTopSaoMaoFXRenderer.material.SetColor("_yanse", initBabyTopSaoMaoFXRendererColor);
  353. babyTopSaoMaoFXRenderer.material.SetColor("_node_2070", initBabyTopSaoMaoFXRendererColor);
  354. babyTopSaoMaoFXRenderer.material.SetColor("_node_3228", initBabyTopSaoMaoFXRendererColor);
  355. babyTopSaoMaoFXRenderer.gameObject.SetActive(false);
  356. IsOneOpenBabyTopSaoMaoFXShowOrHeid = true;
  357. }
  358. private void InitBabyTrunk()
  359. {
  360. babyTrunkRenderer.material.SetFloat("_Ani", 0);
  361. initBabyTrunRongjie = 1;
  362. MaxBabyTrunRongjie = 1;
  363. minBabyTrunRongjie = 0;
  364. babyTrunkRenderer.material.SetFloat("_rongjie", 1);
  365. isUserDownBabyTrunkSlider = false;
  366. }
  367. /// <summary>
  368. /// 滑动头部滑块
  369. /// </summary>
  370. public void BabyTopSliderValueChaged()
  371. {
  372. babyTopRenderer.material.SetFloat("_Ani", babyTopSlider.value);
  373. ct1Renderer.material.SetFloat("_Ani", babyTopSlider.value);
  374. }
  375. /// <summary>
  376. /// 滑动身体滑块
  377. /// </summary>
  378. public void BabyTrunkSliderValueChaged()
  379. {
  380. babyTrunkRenderer.material.SetFloat("_Ani", babyTrunkSlider.value);
  381. // Debug.Log(babyTrunkSlider.value + "=>babyTrunkSlider.value");
  382. if (babyTrunkSlider.value <= 0.1f)
  383. {
  384. ShowOrHeidBbabyTrunkUI(0, babyTrunkGamesUIList, "r4");
  385. }
  386. else if (babyTrunkSlider.value >= 0.1f && babyTrunkSlider.value < 0.3f)
  387. {
  388. ShowOrHeidBbabyTrunkUI(1, babyTrunkGamesUIList, "r3");
  389. }
  390. else if (babyTrunkSlider.value >= 0.3f && babyTrunkSlider.value < 0.5f)
  391. {
  392. ShowOrHeidBbabyTrunkUI(2, babyTrunkGamesUIList, "r2");
  393. }
  394. else if (babyTrunkSlider.value >= 0.5f && babyTrunkSlider.value < 1f)
  395. {
  396. ShowOrHeidBbabyTrunkUI(3, babyTrunkGamesUIList, "r1");
  397. }
  398. }
  399. // Update is called once per frame
  400. void Update()
  401. {
  402. if (_waitTime <= 2)
  403. {
  404. _waitTime += Time.deltaTime;
  405. if (_waitTime > 2)
  406. {
  407. isUserDownBabyTrunkSlider = false;
  408. }
  409. }
  410. //根据bool 显示或关闭 整体模型
  411. if (_isStartShow)
  412. {
  413. // Debug.Log("++++++++++++++++++++++++++++++++++");
  414. if (initStartRentiRendererFloat >= minStartRentiRendererFloat)
  415. {
  416. initStartRentiRendererFloat -= Time.deltaTime * 0.3f;
  417. startRentiRenderer.material.SetFloat("_Float1", initStartRentiRendererFloat);
  418. }
  419. //if (initTopTxtsTxtColorA <= maxTopTxtsTxtColorA)
  420. //{
  421. // Debug.Log("22222222222222222222222222");
  422. // initTopTxtsTxtColorA += Time.deltaTime * 0.3f;
  423. // ShowOrHeidTextsColorA("ChangeTextMeshPro", topTextsList, initTopTxtsTxtColorA, false);
  424. //}
  425. //if (inittopSlidesColorRGB <= maxtopSlidesColorRGB)
  426. //{
  427. // Debug.Log("111111111111111111111111111111111");
  428. // inittopSlidesColorRGB += Time.deltaTime * 0.3f;
  429. // ShowOrHeidTextsColorA("ChangeMeshRenderer", topSlidesList, inittopSlidesColorRGB, true);
  430. //}
  431. if (isUserDownBabyTrunkSlider)
  432. {
  433. if (initBabyTrunRongjie >= minBabyTrunRongjie)
  434. {
  435. initBabyTrunRongjie -= Time.deltaTime * 1f;
  436. babyTrunkRenderer.material.SetFloat("_rongjie", initBabyTrunRongjie);
  437. }
  438. }
  439. //else
  440. //{
  441. // if (initBabyTrunRongjie <= MaxBabyTrunRongjie)
  442. // {
  443. // Debug.Log("444444444444444444444444");
  444. // initBabyTrunRongjie += Time.deltaTime * 0.04f;
  445. // babyTrunkRenderer.material.SetFloat("_rongjie", initBabyTrunRongjie);
  446. // }
  447. // else
  448. // {
  449. // muscle.SetActive(false);
  450. // }
  451. //}
  452. }
  453. //else
  454. //{
  455. // // Debug.Log("-----------------------------------");
  456. // if (initStartRentiRendererFloat <= maxStartRentiRendererFloat)
  457. // {
  458. // initStartRentiRendererFloat += Time.deltaTime * 0.3f;
  459. // startRentiRenderer.material.SetFloat("_Float1", initStartRentiRendererFloat);
  460. // }
  461. // if (initTopTxtsTxtColorA >= minTopTxtsTxtColorA)
  462. // {
  463. // initTopTxtsTxtColorA -= Time.deltaTime * 0.3f;
  464. // ShowOrHeidTextsColorA("ChangeTextMeshPro", topTextsList, initTopTxtsTxtColorA, false);
  465. // }
  466. // if (inittopSlidesColorRGB >= mintopSlidesColorRGB)
  467. // {
  468. // inittopSlidesColorRGB -= Time.deltaTime * 0.3f;
  469. // ShowOrHeidTextsColorA("ChangeMeshRenderer", topSlidesList, inittopSlidesColorRGB, false);
  470. // }
  471. // if (initBabyTrunRongjie <= MaxBabyTrunRongjie)
  472. // {
  473. // initBabyTrunRongjie += Time.deltaTime * 0.3f;
  474. // babyTrunkRenderer.material.SetFloat("_rongjie", initBabyTrunRongjie);
  475. // }
  476. //}
  477. #if UNITY_EDITOR
  478. if (Input.GetKey(KeyCode.J))
  479. {
  480. StartOrOpenRenTiObj(true);
  481. }
  482. else if (Input.GetKey(KeyCode.K))
  483. {
  484. StartOrOpenRenTiObj(false);
  485. }
  486. #endif
  487. }
  488. public void ShowOrHeidTextsColorA(string str, GameObject[] games, float colorA, bool isOpenBoxCollider)
  489. {
  490. if (str == "ChangeTextMeshPro")
  491. {
  492. if (isOpenBoxCollider)//这里用关闭 “手势捏住下方滑块滑动条”
  493. {
  494. games[1].GetComponent<TextMeshPro>().color = new Color(1, 1, 1, 0);
  495. }
  496. else
  497. {
  498. for (int i = 0; i < games.Length; i++)
  499. {
  500. games[i].GetComponent<TextMeshPro>().color = new Color(1, 1, 1, colorA);
  501. }
  502. }
  503. }
  504. else if (str == "ChangeMeshRenderer")
  505. {
  506. for (int i = 0; i < games.Length; i++)
  507. {
  508. games[i].GetComponent<BoxCollider>().enabled = isOpenBoxCollider;
  509. games[i].GetComponent<MeshRenderer>().material.color = new Color(colorA, colorA, colorA);
  510. }
  511. }
  512. }
  513. /// <summary>
  514. /// 开启或关闭人体
  515. /// </summary>
  516. /// <param name="isOpen"></param>
  517. public void StartOrOpenRenTiObj(bool isOpen)
  518. {
  519. IsStartShow = isOpen;
  520. }
  521. /// <summary>
  522. /// 关闭或显示人体脑部特效
  523. /// </summary>
  524. /// <param name="isOpen"></param>
  525. public void Show_BabyTopSaoMaoFX(string str)
  526. {
  527. if (str == "ShowBobyTopSaoMiaoFX")
  528. {
  529. babyTopSaoMaoFXRenderer.gameObject.SetActive(true);
  530. anim_babyTopSaoMaoFX.Play("startSaoMiao");
  531. }
  532. else if (str == "HeidBobyTopSaoMiaoFX")
  533. {
  534. anim_babyTopSaoMaoFX.Play("retrunSaoMiao");
  535. }
  536. _headFunction.functionValues[0].value = (int)(babyTopSlider.value * 100);
  537. // GameManager.Instance.SendFunctionInfo2S(_headFunction);
  538. ShowOrHeidTextsColorA("ChangeTextMeshPro", topTextsList, initTopTxtsTxtColorA, true);
  539. }
  540. /// <summary>
  541. /// 关闭或现实人体躯干特效
  542. /// </summary>
  543. /// <param name="str"></param>
  544. public void Show_BabyTrunkFX(string str)
  545. {
  546. if (str == "ShowBobyTrunkFX")
  547. {
  548. muscle.SetActive(true);
  549. isUserDownBabyTrunkSlider = true;
  550. }
  551. else if (str == "HeidBobyTrunkFX")
  552. {
  553. isUserDownBabyTrunkSlider = false;
  554. }
  555. _bodyFunction.functionValues[0].value = (int)(babyTrunkSlider.value * 100);
  556. // GameManager.Instance.SendFunctionInfo2S(_bodyFunction);
  557. // Debug.LogError(str + "=>str");
  558. ShowOrHeidTextsColorA("ChangeTextMeshPro", topTextsList, initTopTxtsTxtColorA, true);
  559. }
  560. // int lastgamesNum=-1;
  561. private void ShowOrHeidBbabyTrunkUI(int index, GameObject[] games, string animName)
  562. {
  563. if (index==-1)
  564. {
  565. return;
  566. }
  567. // Debug.Log(index + "=>index");
  568. for (int i = 0; i < games.Length; i++)
  569. {
  570. if (i != index)
  571. {
  572. // games[i].SetActive(true);
  573. // Debug.Log(i + "=>+++++back");
  574. games[i].gameObject.GetComponent<Animator>().SetBool("Open", true);
  575. games[i].gameObject.transform.localPosition = new Vector3(999f, 999f, 999f);
  576. }
  577. else
  578. {
  579. switch (index)
  580. {
  581. case 0:
  582. games[i].GetComponent<Animator>().SetBool("Open", false);
  583. games[0].gameObject.transform.localPosition = new Vector3(-0.0353f, 0.131f, 0.0618f);
  584. break;
  585. case 1:
  586. games[i].GetComponent<Animator>().SetBool("Open", false);
  587. // games[1].gameObject.GetComponent<Animator>().Play(animName);
  588. games[1].gameObject.transform.localPosition = new Vector3(-0.0077f, 0.1765f, 0.06325f);
  589. break;
  590. case 2:
  591. games[i].GetComponent<Animator>().SetBool("Open", false);
  592. // games[2].gameObject.GetComponent<Animator>().Play(animName);
  593. games[2].gameObject.transform.localPosition = new Vector3(-0.0124f, 0.2897f, 0.0449f);
  594. break;
  595. case 3:
  596. games[i].GetComponent<Animator>().SetBool("Open", false);
  597. // games[3].gameObject.GetComponent<Animator>().Play(animName);
  598. games[3].gameObject.transform.localPosition = new Vector3(-0.0206f, 0.3177f, 0.063f);
  599. break;
  600. }
  601. }
  602. }
  603. }
  604. private IEnumerator waitOfAnimEndHeidGameObj(float timer, GameObject obj, bool isB)
  605. {
  606. yield return new WaitForSeconds(timer);
  607. obj.SetActive(isB);
  608. }
  609. private IEnumerator waitOfInit(float timer)
  610. {
  611. yield return new WaitForSeconds(timer);
  612. Init();
  613. }
  614. }