You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
CrowdControl/Assets/3rd/StompyRobot/SRDebugger/Scripts/UI/Other/ScrollSettingsBehaviour.cs

24 lines
628 B
C#

namespace SRDebugger.UI.Other
{
using UnityEngine;
using UnityEngine.UI;
[RequireComponent(typeof (ScrollRect))]
public class ScrollSettingsBehaviour : MonoBehaviour
{
public const float ScrollSensitivity = 40f;
private void Awake()
{
var scrollRect = GetComponent<ScrollRect>();
scrollRect.scrollSensitivity = ScrollSensitivity;
if (!Internal.SRDebuggerUtil.IsMobilePlatform)
{
scrollRect.movementType = ScrollRect.MovementType.Clamped;
scrollRect.inertia = false;
}
}
}
}