ScrollSettingsBehaviour.cs 628 B

1234567891011121314151617181920212223
  1. namespace SRDebugger.UI.Other
  2. {
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. [RequireComponent(typeof (ScrollRect))]
  6. public class ScrollSettingsBehaviour : MonoBehaviour
  7. {
  8. public const float ScrollSensitivity = 40f;
  9. private void Awake()
  10. {
  11. var scrollRect = GetComponent<ScrollRect>();
  12. scrollRect.scrollSensitivity = ScrollSensitivity;
  13. if (!Internal.SRDebuggerUtil.IsMobilePlatform)
  14. {
  15. scrollRect.movementType = ScrollRect.MovementType.Clamped;
  16. scrollRect.inertia = false;
  17. }
  18. }
  19. }
  20. }