ScrollRect.decelerationRate

切换到手册
public float decelerationRate ;

描述

移动减速的速率。

减速度是每秒的速度下降。此值为 0.5 时,每秒钟速度下降一半。默认值为 0.135。仅当 inertia 启用时,才使用减速率。

using UnityEngine;
using System.Collections;
using UnityEngine.UI; // Required when Using UI elements.

public class ExampleClass : MonoBehaviour { public ScrollRect myScrollRect;

public void Start() { // assigns a new value to the decelerationRate of the scroll rect. // The higher the number the longer it takes to decelerate. myScrollRect.decelerationRate = 5.0f; } }