using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
public enum PageScrollType {
Horizontal, //0
Vertical //1
}
public class PageScrollView : MonoBehaviour, IBeginDragHandler, IEndDragHandler//这里是系统自带的接口,开始拖拽和结束
//拖拽的时候就会使用里面的方法体。
{
#region 字段
protected ScrollRect rect;
protected int pageCount;
private RectTransform content;
protected float[] pages;
public float moveTime = 0.3f;
private float timer = 0;
private float startMovePos;
protected int currentPage = 0;
private bool isDraging = false;
private bool isMoving = false;
// 是不是开启自动滚动
public bool IsAutoScroll;
public float AutoScrollTime = 2;
private float AutoScrollTimer = 0;
public PageScrollType pageScrollType =