ND_SimulationAutomaticControl/Assets/Scripts/UI/UIPanel/LoginScene.cs

57 lines
1.3 KiB
C#

using System;
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
public class LoginScene : BasePanel
{
public TextMeshProUGUI dayText; //日期文本
public TextMeshProUGUI TimeText; //时间文本
protected override void Awake()
{
base.Awake();
OnInit();
}
public void OnInit()
{
dayText = GetControl<TextMeshProUGUI>("日期");
TimeText = GetControl<TextMeshProUGUI>("时间");
}
public void Update()
{
DateTime now = DateTime.Now;
dayText.text = now.ToString("yyyy-MM-dd");
TimeText.text = now.ToString("HH:mm:ss");
}
public override void ShowMe()
{
base.ShowMe();
}
public override void HideMe()
{
base.HideMe();
}
protected override void OnClick(string btnPath)
{
base.OnClick(btnPath);
switch (btnPath)
{
case "登录按钮":
Debug.Log("登录");
Bootstrap.Instance.scenesManager.LoadSceneAsyn(this, "ChooesSubjectScene", () =>
{
Debug.Log("加载场景成功");
//eventCenter.EventTrigger(Enum_EventType.UpdateProgress, 0.9f);
});
break;
}
}
}