UGUI Scroll View 居中显示

UGUI Scroll View 居中显示_第1张图片

 

UGUI Scroll View 居中显示_第2张图片

 

using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
using System.Collections;
using System.Collections.Generic;
using System;

public class UGUIScrollViewCenterOnChild : MonoBehaviour, IBeginDragHandler, IEndDragHandler
{
    public float scrollSpeed = 10;
    public Transform uUIGrid;
    private ScrollRect scrollRect;
    private float[] pageArray;
    private float targetPagePosition = 0f;
    private bool isDrag = false;
    public int pageCount;
    public int currentPage = 0;
    private List items = new List();

    public GameObje

你可能感兴趣的:(u3d)