OnaholeNodeMenuChildThirdRow.cs 1.6 KB

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