OnaholeNodeMenuChildThirdRow.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. using System;
  2. using UnityEngine;
  3. public class OnaholeNodeMenuChildThirdRow : OnaholeBaseNodeMenuManager
  4. {
  5. private void Awake()
  6. {
  7. this.Clear();
  8. }
  9. public void Clear()
  10. {
  11. this.isInputEnabled = false;
  12. this.ClearButtonObject();
  13. }
  14. public void CallSkillSelect(string categoryName)
  15. {
  16. }
  17. public void OnEnterSkill()
  18. {
  19. }
  20. protected override void OnEnterMenu()
  21. {
  22. base.OnEnterMenu();
  23. if (base.selectedNodeButton != null)
  24. {
  25. base.selectedNodeButton.enterEvent();
  26. }
  27. }
  28. protected override void OnCancelMenu()
  29. {
  30. base.OnCancelMenu();
  31. this.isInputEnabled = false;
  32. this.ClearButtonObject();
  33. this.secondRow.ReturnMenu();
  34. }
  35. private void ClearButtonObject()
  36. {
  37. Transform transform = this.menuButtonGrid.transform;
  38. GameObject[] array = new GameObject[transform.childCount];
  39. for (int i = 0; i < transform.childCount; i++)
  40. {
  41. array[i] = transform.GetChild(i).gameObject;
  42. }
  43. for (int j = 0; j < array.Length; j++)
  44. {
  45. UnityEngine.Object.DestroyImmediate(array[j]);
  46. }
  47. transform.DetachChildren();
  48. this.menuButtons.Clear();
  49. }
  50. protected override void Update()
  51. {
  52. if (base.inputDownKey)
  53. {
  54. base.NextItem();
  55. }
  56. else if (base.inputUpKey)
  57. {
  58. base.PrevItem();
  59. }
  60. else if (base.inputEnterKey || base.inputRightKye)
  61. {
  62. this.OnEnterMenu();
  63. }
  64. else if (base.inputCancelKey || base.inputLeftKey)
  65. {
  66. this.OnCancelMenu();
  67. }
  68. }
  69. [SerializeField]
  70. private OnaholeNodeMenuChildSecondRow secondRow;
  71. }