rabidus-test/Assets/LeaderboardAutoscroll.cs

29 lines
614 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class LeaderboardAutoscroll : MonoBehaviour
{
public UnityEngine.UI.Scrollbar Scrollbar;
public float TimeBeforeStart;
public float TimeInterval;
public float TimeScroll;
public LeanTweenType Ease;
private void Start()
{
InvokeRepeating("Scroll", TimeBeforeStart, TimeInterval);
}
private void Scroll()
{
LeanTween.value(1, 0, TimeScroll).setOnUpdate((float x) =>
{
Scrollbar.value = x;
}).setLoopPingPong(1).setEase(Ease);
}
}