using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
//选择关卡的效果,有四页的选择
public class LevelButtonListRect : MonoBehaviour,IBeginDragHandler,IEndDragHandler {
private ScrollRect scrollRect;
public float smoothing = 4;
private float[] pageArray = new float[] { 0, 0.3333f, 0.6666f, 1 }; //分四页 滑动
private float targetHorizontalPosition=0;
private bool isDraging = false;
public Toggle[] togglegroup;
// Use this for initialization
void Start ()
{
scrollRect = GetComponent<ScrollRect>();
}
// Update is called once per frame
void Update ()
{
if(isDraging==false)
scrollRect.horizontalNormalizedPosition = Mathf.Lerp(scrollRect.horizontalNormalizedPosition, targetHorizontalPosition, Time.deltaTime*smoothing);
}
public