54 lines
1.1 KiB
C#
54 lines
1.1 KiB
C#
|
using UnityEngine.UI;
|
|||
|
using UnityEngine;
|
|||
|
|
|||
|
public class NativeUpdateUI : MonoBehaviour
|
|||
|
{
|
|||
|
Text _message;
|
|||
|
Slider _slider;
|
|||
|
// Start is called before the first frame update
|
|||
|
public void Awake()
|
|||
|
{
|
|||
|
_message = transform.Find("BG/Message").GetComponent<Text>();
|
|||
|
_slider = transform.Find("BG/Slider").GetComponent<Slider>();
|
|||
|
}
|
|||
|
|
|||
|
// ÿ<><C3BF><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE>ִ<EFBFBD><D6B4>, <20>ɶ<EFBFBD><C9B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
public void Show(params object[] _params)
|
|||
|
{
|
|||
|
//base.Show(_params);
|
|||
|
|
|||
|
if (_params == null)
|
|||
|
return;
|
|||
|
|
|||
|
if (_params.Length == 2)
|
|||
|
{
|
|||
|
SetProValue((float)_params[0]);
|
|||
|
SetMessage((string)_params[1]);
|
|||
|
}
|
|||
|
else if (_params.Length == 1)
|
|||
|
{
|
|||
|
SetMessage((string)_params[0]);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// <20><>Χ 0-1
|
|||
|
/// </summary>
|
|||
|
/// <param name="pValue"></param>
|
|||
|
private void SetProValue(float pValue)
|
|||
|
{
|
|||
|
_slider.value = pValue;
|
|||
|
}
|
|||
|
|
|||
|
private void SetMessage(string pValue)
|
|||
|
{
|
|||
|
_message.text = pValue;
|
|||
|
}
|
|||
|
|
|||
|
public void RefreshPregress(string message, float v)
|
|||
|
{
|
|||
|
_message.text = message;
|
|||
|
_slider.value = v;
|
|||
|
}
|
|||
|
}
|