50 lines
1.5 KiB
C#
50 lines
1.5 KiB
C#
|
|
using UnityEngine;
|
||
|
|
using UnityEngine.UI;
|
||
|
|
using ZXKFramework;
|
||
|
|
public class Result : UIBase
|
||
|
|
{
|
||
|
|
public override string Name => "Result";
|
||
|
|
public override string GroupName => UIGroupLiao.Result.ToString();
|
||
|
|
public Text timeText;
|
||
|
|
public Text processText;
|
||
|
|
public Text scoreText;
|
||
|
|
public override void HandleEvent(string name, object data)
|
||
|
|
{
|
||
|
|
|
||
|
|
}
|
||
|
|
public override void Init(IUIManager uictrl)
|
||
|
|
{
|
||
|
|
base.Init(uictrl);
|
||
|
|
transform.FindFirst<Text>("Text1").text = LanguageTools.Get(3);
|
||
|
|
transform.FindFirst<Text>("Text2").text = LanguageTools.Get(4);
|
||
|
|
transform.FindFirst<Text>("Text3").text = LanguageTools.Get(5);
|
||
|
|
transform.FindFirst<Text>("Text4").text = LanguageTools.Get(6);
|
||
|
|
timeText = transform.FindFirst<Text>("Text1Value");
|
||
|
|
processText = transform.FindFirst<Text>("Text2Value");
|
||
|
|
scoreText = transform.FindFirst<Text>("Text3Value");
|
||
|
|
ResetAllText();
|
||
|
|
transform.FindFirst<Button>("HomeBtn").onClick.AddListener(() =>
|
||
|
|
{
|
||
|
|
Game.Instance.eventManager.Raise(new HomeEvent() { type = "Welcome"});
|
||
|
|
});
|
||
|
|
}
|
||
|
|
public void SetTime(string value)
|
||
|
|
{
|
||
|
|
timeText.text = value;
|
||
|
|
}
|
||
|
|
public void SetProcess(string value)
|
||
|
|
{
|
||
|
|
processText.text = value + "%";
|
||
|
|
}
|
||
|
|
public void SetScore(string value)
|
||
|
|
{
|
||
|
|
scoreText.text = value;
|
||
|
|
}
|
||
|
|
public void ResetAllText()
|
||
|
|
{
|
||
|
|
timeText.text = "00:00:00";
|
||
|
|
processText.text = "00%";
|
||
|
|
scoreText.text = "00";
|
||
|
|
}
|
||
|
|
}
|