You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
469 B
24 lines
469 B
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class SliderUI : MonoBehaviour
|
|
{
|
|
[SerializeField] private Image image;
|
|
[SerializeField] private Slider slider;
|
|
[Header("image的最大长度")]
|
|
public float X;
|
|
void Start()
|
|
{
|
|
|
|
}
|
|
|
|
|
|
void Update()
|
|
{
|
|
var value =slider.value;
|
|
image.rectTransform.anchoredPosition= new Vector3(value*X, 0, 0);
|
|
}
|
|
}
|