Slider滑动条操作
Slider滑动条操作
代码
using UnityEngine; using UnityEngine.UI; public class Juse : MonoBehaviour { public Slider slider; void Start() { float num = 4; string str = "string"; slider.onValueChanged.AddListener((value) => SliderControl(value, num, str)); } public void SliderControl(float value1, float num1, string str1) { Debug.Log(value1 + " " + num1 + " " + str1); } }