UIDragScrollViewCustom.cs 697 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using System;
  2. using UnityEngine;
  3. [AddComponentMenu("NGUI/Interaction/Drag Scroll View Custom")]
  4. public class UIDragScrollViewCustom : UIDragScrollView
  5. {
  6. protected override void OnPress(bool pressed)
  7. {
  8. if (!this.enabledOnPress)
  9. {
  10. return;
  11. }
  12. base.OnPress(pressed);
  13. }
  14. protected override void OnDrag(Vector2 delta)
  15. {
  16. if (!this.enabledOnDrag)
  17. {
  18. return;
  19. }
  20. base.OnDrag(delta);
  21. }
  22. protected override void OnScroll(float delta)
  23. {
  24. if (!this.enabledOnScroll)
  25. {
  26. return;
  27. }
  28. base.OnScroll(delta);
  29. }
  30. [SerializeField]
  31. public bool enabledOnPress = true;
  32. [SerializeField]
  33. public bool enabledOnDrag = true;
  34. [SerializeField]
  35. public bool enabledOnScroll = true;
  36. }