using UnityEngine;
using System.Collections;
using UnityEngine.Events;
using UnityEngine.EventSystems;
using UnityEngine.UI;
using System;
[AddComponentMenu("UI/SliderButton", 27)]
public class SliderButton : MonoBehaviour, IPointerDownHandler, IPointerClickHandler, IPointerUpHandler, IDragHandler
{
public Image BgImg;
public Image handleImg;
public Sprite BgHighlightedSprite;
public Sprite BgPressedSprite;
public Sprite handleHighlightedSprite;
public Sprite handlePressedSprite;
public RectTransform handleParent;
public RectTransform handle;
private float handleParentWidth;
private bool isMove;
private float handlePosX;
private float handlePosY;
private Color color = new Color(255 / 255f, 255 / 255f, 255 / 255f);
[Range(0, 1)]
public float moveSpeed = 0.1f;
[Range(0, 1)]
public float value = 0;
public bool lucency = false;
private enum handlerState
Unity UGUI 滑动按钮(仿ios按钮)
最新推荐文章于 2023-12-28 17:20:45 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)