MenuListDlg.cs 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. using Studio.Scripts;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. using XRTool.Util;
  6. using XRTool.WorldUI;
  7. namespace ShadowStudio.UI
  8. {
  9. [RequireComponent(typeof(WorldDlg))]
  10. public class MenuListDlg : UnitySingleton<MenuListDlg>
  11. {
  12. /// <summary>
  13. /// 房间父物体的RoomList脚本
  14. /// </summary>
  15. public MenuUI _menuUI
  16. {
  17. get;
  18. set;
  19. }
  20. void Start()
  21. {
  22. WorldDlg dlg = GetComponent<WorldDlg>();
  23. _menuUI = dlg.GetBreadthChild<MenuUI>("MenuUI");
  24. //TODO 感觉这个位置不是太合理
  25. HomeProxy.Instance.GetModelList();
  26. }
  27. /// <summary>
  28. /// 显示房间游戏对象的方法
  29. /// </summary>
  30. public void Show()
  31. {
  32. if (_menuUI != null)
  33. _menuUI.ShowItemEffect();
  34. }
  35. /// <summary>
  36. /// 隐藏房间游戏对象的方法
  37. /// </summary>
  38. public void Hide()
  39. {
  40. if (_menuUI != null)
  41. _menuUI.HideItemEffect();
  42. }
  43. /// <summary>
  44. /// 刷新按钮显示状态
  45. /// </summary>
  46. public void UpdateBtn()
  47. {
  48. if (_menuUI != null)
  49. {
  50. _menuUI.RefreshDteBtn();
  51. }
  52. }
  53. /// <summary>
  54. /// 加载数据
  55. /// </summary>
  56. public void LoadData()
  57. {
  58. if (_menuUI != null)
  59. {
  60. _menuUI.LoadData();
  61. }
  62. }
  63. /// <summary>
  64. /// 刷新数据显示
  65. /// </summary>
  66. public void UpdateData()
  67. {
  68. if (_menuUI != null)
  69. {
  70. _menuUI.UpdateData();
  71. }
  72. }
  73. private void OnEnable()
  74. {
  75. Show();
  76. }
  77. }
  78. }