OnaholeNodeSlider.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. using System;
  2. using UnityEngine;
  3. public class OnaholeNodeSlider : MonoBehaviour, IOnaholeNodeButton
  4. {
  5. public string text
  6. {
  7. get
  8. {
  9. return this.textLabel.text;
  10. }
  11. set
  12. {
  13. this.textLabel.text = ((!string.IsNullOrEmpty(value)) ? value : string.Empty);
  14. }
  15. }
  16. public string uniqueName { get; set; }
  17. public OnaholeNodeButton.SelectType selectType
  18. {
  19. get
  20. {
  21. return this.selectType_;
  22. }
  23. set
  24. {
  25. this.selectType_ = value;
  26. if (value == OnaholeNodeButton.SelectType.None)
  27. {
  28. this.bg.alpha = this.defaultBGAlpha;
  29. this.textLabel.color = Color.white;
  30. }
  31. else if (value == OnaholeNodeButton.SelectType.Focus)
  32. {
  33. this.bg.alpha = 1f;
  34. this.textLabel.color = Color.white;
  35. }
  36. else if (value == OnaholeNodeButton.SelectType.Select)
  37. {
  38. this.bg.alpha = 1f;
  39. this.textLabel.color = Color.yellow;
  40. }
  41. }
  42. }
  43. public float sliderValue
  44. {
  45. get
  46. {
  47. return (this.sliderData == null) ? 0f : this.sliderData.slider.value;
  48. }
  49. set
  50. {
  51. if (this.sliderData != null)
  52. {
  53. this.sliderData.slider.value = value;
  54. }
  55. }
  56. }
  57. public void Awake()
  58. {
  59. this.defaultBGAlpha = this.bg.alpha;
  60. this.selectType = OnaholeNodeButton.SelectType.None;
  61. }
  62. public void SetSliderType(OnaholeNodeSlider.SliderType type)
  63. {
  64. }
  65. private void Update()
  66. {
  67. }
  68. private void OnChangeSliderValue(AbstractSliderData obj)
  69. {
  70. obj.ChangeSliderValue();
  71. }
  72. GameObject IOnaholeNodeButton.get_gameObject()
  73. {
  74. return base.gameObject;
  75. }
  76. [SerializeField]
  77. private UIWidget bg;
  78. [SerializeField]
  79. private UILabel textLabel;
  80. [SerializeField]
  81. private UISlider valueSlider;
  82. private float defaultBGAlpha;
  83. private OnaholeNodeButton.SelectType selectType_;
  84. private AbstractSliderData sliderData;
  85. public enum SliderType
  86. {
  87. Sensitivity,
  88. HoleSync,
  89. HoleAutoSpeed,
  90. HoleAutoInsertStartPos,
  91. HoleAutoInsertEndPos,
  92. MaidSensitivity,
  93. ManAlpha
  94. }
  95. }