ConfigOptionUiData.cs 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. namespace KairoEngine.Core.ConfigOptions
  5. {
  6. [System.Serializable]
  7. public class ConfigOptionUiData
  8. {
  9. public string name;
  10. public string description;
  11. public ConfigOptionUIType uiElementType;
  12. public SliderData sliderData;
  13. public CheckboxData checkboxData;
  14. public DropdownData dropdownData;
  15. [System.Serializable] public class SliderData
  16. {
  17. public float minValue, maxValue, currentValue;
  18. public SliderData(float minValue, float maxValue, float currentValue)
  19. {
  20. this.minValue = minValue;
  21. this.maxValue = maxValue;
  22. this.currentValue = currentValue;
  23. }
  24. }
  25. [System.Serializable] public class CheckboxData
  26. {
  27. public bool currentValue;
  28. public CheckboxData(bool value)
  29. {
  30. this.currentValue = value;
  31. }
  32. }
  33. [System.Serializable] public class DropdownData
  34. {
  35. public int currentValue;
  36. public List<string> options;
  37. public DropdownData(int currentValue, List<string> options)
  38. {
  39. this.currentValue = currentValue;
  40. this.options = options;
  41. }
  42. }
  43. public ConfigOptionUiData(string name, string description, SliderData sliderData)
  44. {
  45. this.name = name;
  46. this.description = description;
  47. this.uiElementType = ConfigOptionUIType.Slider;
  48. this.sliderData = sliderData;
  49. }
  50. public ConfigOptionUiData(string name, string description, CheckboxData checkboxData)
  51. {
  52. this.name = name;
  53. this.description = description;
  54. this.uiElementType = ConfigOptionUIType.Checkbox;
  55. this.checkboxData = checkboxData;
  56. }
  57. public ConfigOptionUiData(string name, string description, DropdownData dropdownData)
  58. {
  59. this.name = name;
  60. this.description = description;
  61. this.uiElementType = ConfigOptionUIType.Dropdown;
  62. this.dropdownData = dropdownData;
  63. }
  64. }
  65. }