Scenes_YiLiao.cs 22 KB

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