MenuButtomData.cs 1.1 KB

12345678910111213141516171819202122232425
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using Sirenix.OdinInspector;
  5. namespace KairoEngine.UI
  6. {
  7. [System.Serializable]
  8. public class MenuButtomData
  9. {
  10. [HideInInspector] public string name { get { return $"{parent}{(useSubMenus ? "/" : string.Empty)}{title}"; } }
  11. [FoldoutGroup("@name")] public string title = "";
  12. [FoldoutGroup("@name")] public string action= "";
  13. [FoldoutGroup("@name")] public Sprite graphic;
  14. [FoldoutGroup("@name")] public string description= "";
  15. [FoldoutGroup("@name")] public bool showTooltip = true;
  16. [FoldoutGroup("@name"), ShowIf("@showTooltip")] public string tooltipType = "";
  17. [FoldoutGroup("@name")] public bool isInteractable = true;
  18. [HideInInspector] public bool useSubMenus = true;
  19. [FoldoutGroup("@name"), Tooltip("Title of the parent button."), ShowIf("@useSubMenus")] public string parent= "";
  20. [FoldoutGroup("@name"), Tooltip("Is this button the parent of other buttons?"), ShowIf("@useSubMenus")] public bool subMenuParent = false;
  21. [FoldoutGroup("@name")] public GameObject button;
  22. }
  23. }