MenuIcon.cs 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. using TMPro;
  6. using System;
  7. using LitJson;
  8. using ShadowStudio.Model;
  9. using XRTool.Util;
  10. using ShadowStudio.Mgr;
  11. using ShadowStudio.UI;
  12. using DG.Tweening;
  13. using BeinLab.Util;
  14. using UnityEngine.EventSystems;
  15. using Studio.Scripts;
  16. public class MenuIcon : MonoBehaviour, IPointerDownHandler, IPointerClickHandler, IPointerEnterHandler, IPointerExitHandler
  17. {
  18. private DoubleLinkNode<RoomConfig> _dataConfig;
  19. /// <summary>
  20. /// 存储房间的数据信息
  21. /// </summary>
  22. public DoubleLinkNode<RoomConfig> DataConfig { get => _dataConfig; set => _dataConfig = value; }
  23. Button _deleteBtn;//删除按钮
  24. GameObject _show;//显示房间界面
  25. GameObject _showK;//无房间时显示默认界面
  26. TextMesh _peopleNum;//房间人数文本
  27. TextMesh _roomName;//房间名称文本
  28. string _id;//房间ID
  29. string _passWord;//房间密码
  30. bool isClick = false;//房间是否被点击
  31. float _clickTime = 0.2f;//点击按下房间的间隔时间
  32. float _lastTime = 0;//记录开始点击房间时所处的时间
  33. public bool _isDrag = false;//房间是否被拖拽
  34. public static bool isjoinRoom;
  35. /// <summary>
  36. /// 记录物体的缩放值
  37. /// </summary>
  38. public Vector3 initAV3
  39. {
  40. get;
  41. set;
  42. }
  43. /// <summary>
  44. /// 记录所进入房间的ID,用于退出房间时显示指定房间的动画效果
  45. /// </summary>
  46. public static string inID;
  47. bool isRoomShow;
  48. bool isInit;
  49. bool isHide;
  50. /// <summary>
  51. /// 所处的位置索引(用于设置动画延迟)
  52. /// </summary>
  53. public int RoomIndex
  54. {
  55. get;
  56. set;
  57. }
  58. /// <summary>
  59. /// 进入或者退出房间时的位置变换记录
  60. /// </summary>
  61. public static Vector3 itemPos;
  62. public void Init()//初始化
  63. {
  64. HomeProxy.Instance.DeleteRoomAction += DeleteRoomHandler;
  65. _deleteBtn = transform.Find("DeleteBtn").GetComponent<Button>();
  66. _show = transform.Find("Show").gameObject;
  67. _showK = transform.Find("ShowK").gameObject;
  68. _peopleNum = transform.Find("Text/UIRoot/PeopleNumText").GetComponent<TextMesh>();
  69. _roomName = transform.Find("Text/UIRoot/FangzhuText").GetComponent<TextMesh>();
  70. _deleteBtn.onClick.AddListener(ClickDeleteBtn);
  71. EventTool._displayDelete += DisplayDeleteBtn;//注册点击删除按钮的事件
  72. if (CommonMethod.isZiDong)
  73. {
  74. if (!isjoinRoom)
  75. {
  76. isjoinRoom = true;
  77. Invoke("joinZIDONG", 2f);
  78. }
  79. }
  80. }
  81. void joinZIDONG()
  82. {
  83. WSHandler.Room.OnInit -= onInit;
  84. WSHandler.Room.OnJoinRoom -= onJoinRoom;
  85. WSHandler.Rtc.onRtcInit -= onRtcInit;
  86. WSHandler.Room.OnInit += onInit;
  87. WSHandler.Room.OnJoinRoom += onJoinRoom;
  88. WSHandler.Rtc.onRtcInit += onRtcInit;
  89. _id = "43";
  90. WSHandler.roominit(_id);
  91. }
  92. /// <summary>
  93. /// "x"按钮是否显示
  94. /// </summary>
  95. bool _isShow = false;
  96. void DisplayDeleteBtn()//点击删除按钮后,显示“x”按钮
  97. {
  98. _isShow = !_isShow;
  99. if (_id != "" && _deleteBtn != null)
  100. _deleteBtn.gameObject.SetActive(_isShow);
  101. }
  102. void ClickDeleteBtn()// 回调方法:点击“ x ”删除按钮
  103. {
  104. _deleteBtn.enabled = false;
  105. Invoke("ReDeleteBtn", 1f);
  106. CommonMethod.ShowPopUp(PopType.Cancel, LanguageMgr.Instance.GetMessage("1063").Message, LanguageMgr.Instance.GetMessage("1064").Message, () =>
  107. {
  108. SendDelete();
  109. }, LanguageMgr.Instance.GetMessage("1065").Message, null, LanguageMgr.Instance.GetMessage("1058").Message);
  110. }
  111. private void ReDeleteBtn()
  112. {
  113. _deleteBtn.enabled = true;
  114. }
  115. /// <summary>
  116. /// 发送删除房间消息
  117. /// </summary>
  118. public void SendDelete()
  119. {
  120. HomeProxy.Instance.RequestDeleteRoom(int.Parse(_id.Trim()));
  121. }
  122. /// <summary>
  123. /// 回调函数: 在删除房间成功后,刷新删除按钮的显示状态
  124. /// </summary>
  125. public void ChangeDteBtn()
  126. {
  127. if (_deleteBtn != null)
  128. {
  129. if (_id == "")
  130. {
  131. _deleteBtn.gameObject.SetActive(false);
  132. }
  133. else
  134. {
  135. _deleteBtn.gameObject.SetActive(true);
  136. }
  137. }
  138. }
  139. /// <summary>
  140. /// 刷新房间数据显示
  141. /// </summary>
  142. public void RefreshData()
  143. {
  144. if (_dataConfig != null)
  145. {
  146. gameObject.SetActive(true);
  147. _roomName.text = "房间名" + DataConfig.Value.Room_name;
  148. _id = DataConfig.Value.Id;
  149. if (DataConfig.Value.Room_password != null)
  150. {
  151. _passWord = DataConfig.Value.Room_password;
  152. }
  153. switch (DataConfig.Value.Type)
  154. {
  155. case "1":
  156. _peopleNum.text = "个人房间";
  157. break;
  158. case "2":
  159. _peopleNum.text = "房间人数" + DataConfig.Value.Number + "/" + DataConfig.Value.Max_member;
  160. break;
  161. default:
  162. break;
  163. }
  164. if (_id == "")
  165. {
  166. _show.SetActive(false);
  167. _showK.SetActive(true);
  168. _roomName.text = "Studio";
  169. _peopleNum.text = "添加房间";
  170. if (_deleteBtn != null)
  171. {
  172. _deleteBtn.gameObject.SetActive(false);
  173. }
  174. }
  175. else
  176. {
  177. _show.SetActive(true);
  178. _showK.SetActive(false);
  179. _deleteBtn.gameObject.SetActive(_isShow);
  180. }
  181. }
  182. else
  183. {
  184. gameObject.SetActive(false);
  185. }
  186. isInit = true;
  187. }
  188. /// <summary>
  189. /// 当点击房间元素时,执行的方法
  190. /// </summary>
  191. public void ClickSelf()
  192. {
  193. if (!isClick)
  194. {
  195. isClick = true;
  196. AgoraRTCManager.Instance.ChannelName = _id;
  197. // AgoraVideoAudioManager.Instance.JoinChannel();
  198. ClickSelf2();
  199. //if (_id != "")
  200. //{
  201. // Debug.Log(".................." + _id);
  202. // AgoraVideoAudioManager.Instance.SetChinnelName(_id);
  203. // AgoraVideoAudioManager.Instance.JoinChannel();
  204. // WSHandler.Room.OnInit -= onInit;
  205. // WSHandler.Room.OnJoinRoom -= onJoinRoom;
  206. // WSHandler.Rtc.onRtcInit -= onRtcInit;
  207. // WSHandler.Room.OnInit += onInit;
  208. // WSHandler.Room.OnJoinRoom += onJoinRoom;
  209. // WSHandler.Rtc.onRtcInit += onRtcInit;
  210. // WSHandler.roominit(_id);
  211. //}
  212. //else
  213. //{
  214. // OnClickCreateRoom();
  215. //}
  216. }
  217. }
  218. public void ClickSelf2()
  219. {
  220. Debug.Log("ClickSelf2");
  221. if (_id != "")
  222. {
  223. WSHandler.Room.OnInit -= onInit;
  224. WSHandler.Room.OnJoinRoom -= onJoinRoom;
  225. WSHandler.Rtc.onRtcInit -= onRtcInit;
  226. WSHandler.Room.OnInit += onInit;
  227. WSHandler.Room.OnJoinRoom += onJoinRoom;
  228. WSHandler.Rtc.onRtcInit += onRtcInit;
  229. WSHandler.roominit(_id);
  230. // effectRoom();
  231. }
  232. else
  233. {
  234. OnClickCreateRoom();
  235. }
  236. }
  237. /// <summary>
  238. /// 点击创建房间执行的操作
  239. /// </summary>
  240. private void OnClickCreateRoom()
  241. {
  242. isClick = false;
  243. HomeMgr.Instance._menuListDlg.Hide();
  244. CreateSearchRoomDlg.Instance.dlg.hideDlg();
  245. Invoke("GotoView", 1.3f);
  246. }
  247. /// <summary>
  248. /// 打开创建房间界面,关闭房间游戏对象界面
  249. /// </summary>
  250. private void GotoView()
  251. {
  252. if (CreateRoomDlg.Instance)
  253. {
  254. CreateRoomDlg.Instance.Init();
  255. }
  256. HomeMgr.Instance.ShowView(HomeMgr.CREATROOMDLG);
  257. HomeMgr.Instance.roomListDlg.SetActive(false);
  258. }
  259. private void onRtcInit(JsonData data)
  260. {
  261. // effectRoom();
  262. }
  263. private GameObject _showObj;
  264. /// <summary>
  265. /// 处于显示状态的房间游戏对象
  266. /// </summary>
  267. private GameObject Show
  268. {
  269. get
  270. {
  271. if (_id != "")
  272. {
  273. _showObj = _show;
  274. }
  275. else
  276. {
  277. _showObj = _showK;
  278. }
  279. return _showObj;
  280. }
  281. }
  282. GameObject frontBG;
  283. /// <summary>
  284. /// 房间游戏对象的背景板
  285. /// </summary>
  286. public GameObject FrontBG
  287. {
  288. get
  289. {
  290. if (!frontBG)
  291. {
  292. frontBG = UnityUtil.GetBreadthChild<Transform>(Show.transform, "FrontBG").gameObject;
  293. }
  294. return frontBG;
  295. }
  296. }
  297. GameObject bottom;
  298. /// <summary>
  299. /// 房间游戏对象的地板
  300. /// </summary>
  301. public GameObject Bottom
  302. {
  303. get
  304. {
  305. if (!bottom)
  306. {
  307. bottom = UnityUtil.GetBreadthChild<Transform>(Show.transform, "dibu").gameObject;
  308. }
  309. return bottom;
  310. }
  311. }
  312. GameObject picture;
  313. /// <summary>
  314. /// 房间游戏对象里的照片
  315. /// </summary>
  316. public GameObject Picture
  317. {
  318. get
  319. {
  320. if (!picture)
  321. {
  322. picture = UnityUtil.GetBreadthChild<Transform>(Show.transform, "Picture").gameObject;
  323. }
  324. return picture;
  325. }
  326. }
  327. GameObject people;
  328. /// <summary>
  329. /// 房间游戏对象里的人
  330. /// </summary>
  331. public GameObject People
  332. {
  333. get
  334. {
  335. if (!people)
  336. {
  337. people = UnityUtil.GetBreadthChild<Transform>(Show.transform, "People").gameObject;
  338. }
  339. return people;
  340. }
  341. }
  342. /// <summary>
  343. /// 执行进入场景的动画
  344. /// </summary>
  345. private void effectRoom()
  346. {
  347. itemPos = this.transform.parent.TransformPoint(new Vector3(-130, 0, -400));
  348. Show.transform.parent = null;
  349. this.transform.localScale = initAV3;
  350. HomeMgr.Instance._menuListDlg.Hide();
  351. CreateSearchRoomDlg.Instance.dlg.hideDlg();
  352. Show.transform.DOScale(Show.transform.localScale * 1.5f, 1);
  353. Show.transform.DOMove(itemPos, 1).OnComplete(() =>
  354. {
  355. DontDestroyOnLoad(Show.gameObject);
  356. itemPos = FrontBG.transform.position;
  357. // Picture.transform.LeanRotateY(360, 0.5f).setOnComplete(() => {
  358. // Picture.transform.LeanRotateY(180, 0.5f).setOnComplete(() =>
  359. // {
  360. Bottom.transform.DOMoveY(-1f, 2).SetEase(Ease.InCubic);
  361. Bottom.transform.DOScale(Bottom.transform.localScale * 20, 1f).SetEase(Ease.InCubic);
  362. // Bottom.transform.DOScaleZ(Bottom.transform.localScale.z * 20, 1f);
  363. Bottom.transform.LeanRotateY(180, 1f);
  364. GameEffect.setAlpha(Bottom, 0, 2);
  365. TimerMgr.Instance.CreateTimer(() =>
  366. {
  367. Picture.transform.localEulerAngles = new Vector3(0, 0, 0);
  368. //People.transform.DOScale(People.transform.localScale * 10, 2);
  369. Picture.transform.DOScale(People.transform.localScale * 10, 2).OnComplete<Tween>(() =>
  370. {
  371. Destroy(Show);
  372. });
  373. GameEffect.setAlpha(People, 0, 0.3f);
  374. GameEffect.setAlpha(Picture, 0, 0.2f);
  375. FrontBG.SetActive(false);
  376. }, 0.5f);
  377. Picture.transform.DOScale(new Vector3(0, 0, 0), 0.5f).SetEase(Ease.InBack).OnComplete<Tween>(() => { });
  378. People.transform.DOScale(new Vector3(0, 0, 0), 0.5f).SetEase(Ease.InBack).OnComplete<Tween>(() => { });
  379. HomeMgr.Instance.LoadSence();
  380. });
  381. inID = _id;
  382. }
  383. /// <summary>
  384. /// 点击进入房间后,隐藏房间游戏对象
  385. /// </summary>
  386. public void HideItem()
  387. {
  388. if (Show.transform.parent != null)
  389. {
  390. Vector3 v3 = Show.transform.localScale;
  391. // show.transform.localScale = new Vector3(v3.x, 0, v3.z);
  392. Vector3 pv3 = Show.transform.position;
  393. // show.transform.position = new Vector3(pv3.x, pv3.y + 0.1f, pv3.z);
  394. Show.transform.DOScale(new Vector3(v3.x, 0, v3.z), 0.3f).SetDelay<Tween>(RoomIndex * 0.3f * 0.5f).SetEase<Tween>(Ease.InBack).OnKill<Tween>(() =>
  395. {
  396. Show.transform.localScale = v3;
  397. Show.SetActive(false);
  398. this.gameObject.SetActive(false);
  399. }).OnComplete<Tween>(() =>
  400. {
  401. Show.transform.localScale = v3;
  402. Show.SetActive(false);
  403. this.gameObject.SetActive(false);
  404. });
  405. }
  406. else
  407. {
  408. this.gameObject.SetActive(false);
  409. }
  410. }
  411. /// <summary>
  412. /// 显示房间游戏对象
  413. /// </summary>
  414. public void ShowItem()
  415. {
  416. if (inID != null && inID == _id)
  417. {
  418. Vector3 v3 = MenuListDlg.Instance._menuUI._bezierPointGroup[RoomIndex];
  419. Vector3 v3L = this.transform.localScale;
  420. this.transform.position = itemPos;
  421. this.transform.localScale = v3L * 5f;
  422. this.transform.DOLocalMove(v3, 1);
  423. this.transform.DOScale(v3L, 1);
  424. isRoomShow = true;
  425. Show.transform.DOKill(true);
  426. inID = "None";
  427. Show.SetActive(true);
  428. //这两个参数影响是否在退出房间后,点击这个房间是否还有有放大效果
  429. //isInit = true;
  430. //isRoomShow = false;
  431. }
  432. else
  433. {
  434. isRoomShow = true;
  435. Show.transform.DOKill(true);
  436. Vector3 v3 = Show.transform.localScale;
  437. Show.transform.localScale = new Vector3(v3.x, 0, v3.z);
  438. Show.transform.DOScale(v3, 0.5f).SetDelay<Tween>(RoomIndex * 0.5f * 0.2f).SetEase<Tween>(Ease.OutBack).OnKill<Tween>(() =>
  439. {
  440. isRoomShow = false;
  441. isInit = true;
  442. Show.transform.localScale = v3;
  443. }).OnComplete<Tween>(() =>
  444. {
  445. isRoomShow = false;
  446. Show.transform.localScale = v3;
  447. isInit = true;
  448. }).OnStart<Tween>(() =>
  449. {
  450. Show.SetActive(true);
  451. });
  452. }
  453. }
  454. private void OnEnable()
  455. {
  456. if (initAV3 == Vector3.zero)
  457. initAV3 = this.transform.localScale;
  458. }
  459. /// <summary>
  460. /// 进入房间时,(跳转场景)存储数据
  461. /// </summary>
  462. /// <param name="goods"></param>
  463. /// <param name="peers"></param>
  464. /// <param name="scenes"></param>
  465. /// <param name="currentScene"></param>
  466. private void onJoinRoom(List<GoodsInfo> goods, List<Peer> peers, List<SceneConfig> scenes, SceneConfig currentScene)
  467. {
  468. effectRoom();
  469. CommonMethod.GoodsInfoList = new List<GoodsInfo>();
  470. CommonMethod.IsReceive = true;
  471. CommonMethod.HideLoading();
  472. CommonMethod.GoodsInfoList = goods;
  473. CommonMethod.PeerList = peers;
  474. CommonMethod.scenes = scenes;
  475. CommonMethod.currentScene = currentScene;
  476. CommonMethod.roomConfig = this.DataConfig.Value;
  477. if (!string.IsNullOrEmpty(this._passWord) && this._passWord != DataConfig.Value.Room_password)
  478. {
  479. CommonMethod.roomPassWord = this._passWord;
  480. }
  481. }
  482. /// <summary>
  483. /// 进入房间的初始化操作
  484. /// </summary>
  485. /// <param name="data"></param>
  486. private void onInit(JsonData data)
  487. {
  488. CommonMethod.SelfPeer(data["data"]["peerId"].ToString(), UserInfoMgr.Instance.userConfig.Nick_name);
  489. _passWord = this.DataConfig.Value.Room_password;
  490. if (string.IsNullOrEmpty( _passWord))//如果没有密码,则直接进入房间
  491. {
  492. WSHandler.Room.JoinRoom(_id, "");
  493. // effectRoom();
  494. }
  495. else//否则。。。。
  496. {
  497. // CommonMethod.HideLoading();
  498. CommonMethod.ShowPopUp(PopType.Cancel, LanguageMgr.Instance.GetMessage("1085").Message, LanguageMgr.Instance.GetMessage("1084").Message, null
  499. , LanguageMgr.Instance.GetMessage("1066").Message, () => { CanelJoinRoom(); }, LanguageMgr.Instance.GetMessage("1058").Message, true, (string pass) => { InputJoinRoom(pass); });
  500. }
  501. }
  502. /// <summary>
  503. /// 进入房间(输入密码进入)
  504. /// </summary>
  505. /// <param name="password"></param>
  506. private void InputJoinRoom(string password)
  507. {
  508. CommonMethod.ShowLoading();
  509. WSHandler.Room.JoinRoom(_id, password);
  510. if (password != "")
  511. {
  512. this._passWord = password;
  513. }
  514. }
  515. /// <summary>
  516. /// 当进入房间失败时,取消事件监听
  517. /// </summary>
  518. public void Refeshbool()
  519. {
  520. if (isClick)
  521. {
  522. isClick = false;
  523. WSHandler.Room.OnInit -= onInit;
  524. WSHandler.Room.OnJoinRoom -= onJoinRoom;
  525. WSHandler.Rtc.onRtcInit -= onRtcInit;
  526. }
  527. }
  528. /// <summary>
  529. /// 取消进入房间
  530. /// </summary>
  531. private void CanelJoinRoom()
  532. {
  533. isClick = false;
  534. WSHandler.Room.OnInit -= onInit;
  535. WSHandler.Room.OnJoinRoom -= onJoinRoom;
  536. WSHandler.Rtc.onRtcInit -= onRtcInit;
  537. WSHandler.roomCloes();
  538. }
  539. private void OnDestroy()
  540. {
  541. EventTool._displayDelete -= DisplayDeleteBtn;
  542. WSHandler.Room.OnInit -= onInit;
  543. WSHandler.Room.OnJoinRoom -= onJoinRoom;
  544. WSHandler.Rtc.onRtcInit -= onRtcInit;
  545. if (HomeProxy.Instance)
  546. {
  547. HomeProxy.Instance.DeleteRoomAction -= DeleteRoomHandler;
  548. }
  549. }
  550. /// <summary>
  551. /// 删除房间成功时的回调函数
  552. /// </summary>
  553. private void DeleteRoomHandler(int roomId)
  554. {
  555. if (!string.IsNullOrEmpty(_id))
  556. {
  557. int result = int.Parse(_id);
  558. if (roomId == result)
  559. {
  560. ConfigModel.Instance.RemoveElement(_dataConfig);//删除该数据
  561. if (HomeMgr.Instance.SelfRoomConfigList.Contains(_dataConfig.Value))
  562. {
  563. HomeMgr.Instance.SelfRoomConfigList.Remove(_dataConfig.Value);
  564. }
  565. //如果删除完数据之后,数据个数少于5,则造假一个数据
  566. if (ConfigModel.Instance.Count < 5 && HomeMgr.Instance.SelfRoomConfigList.Count < 5)
  567. {
  568. ConfigModel.Instance.AddElement(new RoomConfig("", "1", "教育", "", "", "", "", "", "", ""));
  569. HomeMgr.Instance.SelfRoomConfigList.Add(new RoomConfig("", "1", "教育", "", "", "", "", "", "", ""));
  570. }
  571. else
  572. {
  573. Debug.Log("数据个数:" + ConfigModel.Instance.Count);
  574. Debug.Log("备份个数:" + HomeMgr.Instance.SelfRoomConfigList.Count);
  575. //Debug.LogError("原始数据与备份数据不同步");
  576. }
  577. EventTool.RearrangeMethod(transform);//通知进行游戏对象和数据的移位
  578. RefreshData();//刷新数据
  579. MenuListDlg.Instance.UpdateBtn();//统一刷新所有按钮状态
  580. }
  581. }
  582. }
  583. public void OnPointerEnter(PointerEventData eventData)
  584. {
  585. if (!isHide && !isRoomShow && isInit)
  586. //LeanTween.scale(this.gameObject, initAV3 * 1.1f, 0.1f);
  587. transform.DOScale(initAV3 * 1.1f, 0.1f);
  588. }
  589. public void OnPointerExit(PointerEventData eventData)
  590. {
  591. if (!isHide && !isRoomShow && isInit)
  592. //LeanTween.scale(this.gameObject, initAV3, 0.1f);
  593. transform.DOScale(initAV3, 0.1f);
  594. }
  595. public void OnPointerDown(PointerEventData eventData)
  596. {
  597. _lastTime = Time.time;
  598. if (!isHide && !isRoomShow && isInit)
  599. //LeanTween.scale(this.gameObject, initAV3 * 0.9f, 0.1f);
  600. transform.DOScale(initAV3 * 0.9f, 0.1f);
  601. }
  602. public void OnPointerClick(PointerEventData eventData)
  603. {
  604. if (Time.time - _lastTime <= _clickTime)
  605. {
  606. if (!_isDrag)
  607. {
  608. ClickSelf();
  609. }
  610. }
  611. if (!isHide && !isRoomShow && isInit)
  612. //LeanTween.scale(this.gameObject, initAV3, 0.1f);.
  613. transform.DOScale(initAV3, 0.1f);
  614. }
  615. }