AkiraPixelWind/Assets/Scripts/Main/UI/MainUI/MainUI.cs
2023-01-11 18:29:59 +08:00

73 lines
1.9 KiB
C#

/*-------------------------------------------------------------------------------------
--- 创建人:
--- 描 述:
--- 创建时间: 2023年1月11日
-------------------------------------------------------------------------------------*/
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using Game;
using TMPro;
using Axibug.Runtime;
namespace Game
{
/// <summary>
/// xx 功能界面
/// </summary>
public class MainUI : UIBase
{
//UIAutoBuild_CtrlDefine
public TextMeshProUGUI tmpName;
public TextMeshProUGUI tmp_HP;
public TextMeshProUGUI tmp_MP;
//UIAutoBuild_CtrlDefine
public override void Awake()
{
//UIAutoBuild_CtrlBind
base.Awake();
Transform tf = transform;
tmpName = tf.Find("BG/tmpName").GetComponent<TextMeshProUGUI>();
tmp_HP = tf.Find("BG/tmp_HP").GetComponent<TextMeshProUGUI>();
tmp_MP = tf.Find("BG/tmp_MP").GetComponent<TextMeshProUGUI>();
//UIAutoBuild_CtrlBind
}
void OnEnable()
{
//UIAutoBuild_EventReg
//UIAutoBuild_EventReg
Reflush();
}
void OnDisable()
{
//UIAutoBuild_EventUnReg
//UIAutoBuild_EventUnReg
}
void Start()
{
}
// 每次显示都执行, 可定义参数
public override void Show(params object[] _params)
{
base.Show(_params);
}
void Reflush()
{
tmp_HP.text = GamePlayEntry.MainPlayer.Player.BaseData.life.curHP + "/" + GamePlayEntry.MainPlayer.Player.BaseData.life.maxHP;
tmp_MP.text = GamePlayEntry.MainPlayer.Player.BaseData.life.curMP + "/" + GamePlayEntry.MainPlayer.Player.BaseData.life.maxMP;
}
}
}