using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using DG.Tweening;
public class MyChangdeIndexBySlider : MonoBehaviour
{
public int minIndex;
public int maxIndex;
public int curindex;
[Header("======差值======")]
public int changeSize=1;
[Header("======循环======")]
public bool isLoop = false;
[Header("======滑动距离======")]
public float maxDistance = 100;
//鼠标位置
private Vector2 beginPos = new Vector2(0, 0);
private Vector2 endPos = new Vector2(0, 0);
private bool isSilder = false;
private void Update()
{
if (Mathf.Abs(changeSize) > maxIndex - minIndex) {
return;
}
//获取鼠标滑动起始坐标和终点坐标
if (Input.GetMouseButtonDown(0))
{
beginPos = new Vector2(Input.mousePos
Unity3D通过鼠标滑动改变数值
最新推荐文章于 2025-02-06 16:39:11 发布