/*------------------------------------------------------------------------------------- --- 创建人: --- 描 述: --- 创建时间: 2023年1月11日 -------------------------------------------------------------------------------------*/ using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using Game; using TMPro; using Axibug.Runtime; namespace Game { /// /// xx 功能界面 /// 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(); tmp_HP = tf.Find("BG/tmp_HP").GetComponent(); tmp_MP = tf.Find("BG/tmp_MP").GetComponent(); //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; } } }