using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class BaseSpeedSlider : MonoBehaviour { Text text; public static BaseSpeedSlider ins; void Start() { ins = this; text = this.transform.Find("Text").GetComponent(); } public void onSlider() { float value = this.GetComponent().value; text.text = "发射速度 " + (value).ToString("#0.00") + "m/s"; } public float getValue() { return this.GetComponent().value * 0.5f; } }