2017-08-02 17:21:45 +08:00
|
|
|
|
namespace UnityEngine.UI.Extensions.Examples
|
|
|
|
|
{
|
|
|
|
|
public class UpdateRadialValue : MonoBehaviour
|
|
|
|
|
{
|
|
|
|
|
public InputField input;
|
|
|
|
|
public RadialSlider slider;
|
2017-07-30 02:09:19 +08:00
|
|
|
|
|
2017-08-02 17:21:45 +08:00
|
|
|
|
// Use this for initialization
|
|
|
|
|
void Start()
|
|
|
|
|
{
|
2017-07-30 02:09:19 +08:00
|
|
|
|
|
2017-08-02 17:21:45 +08:00
|
|
|
|
}
|
2017-07-30 02:09:19 +08:00
|
|
|
|
|
2017-08-02 17:21:45 +08:00
|
|
|
|
// Update is called once per frame
|
|
|
|
|
public void UpdateSliderValue()
|
|
|
|
|
{
|
|
|
|
|
float value;
|
|
|
|
|
float.TryParse(input.text, out value);
|
|
|
|
|
slider.Value = value;
|
|
|
|
|
}
|
2017-07-30 02:09:19 +08:00
|
|
|
|
|
2017-08-02 17:21:45 +08:00
|
|
|
|
public void UpdateSliderAndle()
|
|
|
|
|
{
|
|
|
|
|
int value;
|
|
|
|
|
int.TryParse(input.text, out value);
|
|
|
|
|
slider.Angle = value;
|
|
|
|
|
}
|
2017-07-30 02:09:19 +08:00
|
|
|
|
}
|
2017-08-02 17:21:45 +08:00
|
|
|
|
}
|