VRTouchButtonMgr.cs 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. using System;
  2. using UnityEngine;
  3. public class VRTouchButtonMgr : BaseMgr<PresetButtonMgr>
  4. {
  5. private void Start()
  6. {
  7. GameObject gameObject = GameObject.Find("/UI Root");
  8. this.m_goPresetButtonPanel = gameObject.transform.Find("VRTouchButtonPanel").gameObject;
  9. if (this.m_goPresetButtonPanel == null)
  10. {
  11. Debug.LogError(string.Format("{0}が見つかりませんでした", "VRTouchButtonPanel"));
  12. return;
  13. }
  14. this.m_presetButtonCtrl = this.m_goPresetButtonPanel.GetComponent<VRTouchButtonCtrl>();
  15. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(0);
  16. this.m_presetButtonCtrl.Init(this.m_goPresetButtonPanel, maid);
  17. this.m_goPresetButtonPanel.SetActive(true);
  18. }
  19. public void OpenPresetButtonPanel()
  20. {
  21. this.m_goPresetButtonPanel.SetActive(true);
  22. }
  23. public void ClosePresetButtonPanel()
  24. {
  25. this.m_goPresetButtonPanel.SetActive(false);
  26. }
  27. public void OnButtonClickWithType(string type)
  28. {
  29. string name = UIButton.current.name;
  30. if (type == "PresetButtons" && name == this.m_currentActivePresetBtnName)
  31. {
  32. this.CloseItemPresetsViewer();
  33. this.m_currentActivePresetBtnName = null;
  34. this.m_currentActiveItemPresetBtnName = null;
  35. }
  36. else if (type == "PresetButtons" && name != this.m_currentActivePresetBtnName)
  37. {
  38. if (name != "View")
  39. {
  40. }
  41. this.m_presetButtonCtrl.CreateItemPresetsViewer("PresetButtons", name, this.m_currentActivePresetBtnName);
  42. this.m_currentActivePresetBtnName = name;
  43. this.m_currentActiveItemPresetBtnName = null;
  44. if (name == "View")
  45. {
  46. }
  47. }
  48. else if (type == "ItemPresetsViewer" && name != this.m_currentActiveItemPresetBtnName)
  49. {
  50. this.InitItemPresetBtn(type, name, this.m_currentActiveItemPresetBtnName);
  51. }
  52. }
  53. private void InitItemPresetBtn(string type, string clickBtnName, string currentActiveItemPresetBtnName)
  54. {
  55. this.m_presetButtonCtrl.AdjustItemPresets(type, clickBtnName, currentActiveItemPresetBtnName);
  56. this.m_currentActiveItemPresetBtnName = clickBtnName;
  57. }
  58. public void CloseItemPresetsViewer()
  59. {
  60. this.m_presetButtonCtrl.CreateItemPresetsViewer("PresetButtons", "View", this.m_currentActivePresetBtnName);
  61. this.m_presetButtonCtrl.SetActiveBtn("View", false);
  62. this.m_currentActivePresetBtnName = null;
  63. }
  64. public void UpdateClothesByName(string name)
  65. {
  66. this.m_presetButtonCtrl.ClickClothesByButtonName(name);
  67. }
  68. private GameObject m_goPresetButtonPanel;
  69. private VRTouchButtonCtrl m_presetButtonCtrl;
  70. private string m_currentActivePresetBtnName;
  71. private string m_currentActiveItemPresetBtnName;
  72. public enum ItemTypes
  73. {
  74. Pose,
  75. Clothes,
  76. PriSave,
  77. Voice,
  78. BG
  79. }
  80. }