/*------------------------------------------------------------------------------------- --- 创建人: --- 描 述: --- 创建时间: 2023年1月14日 -------------------------------------------------------------------------------------*/ using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using Game; using TMPro; using Axibug.Runtime; namespace Game { /// /// xx 功能界面 /// public class ScenesTipsUI : UIBase { //UIAutoBuild_CtrlDefine public TextMeshProUGUI tmpTitle; public TextMeshProUGUI tmpSubTitle; //UIAutoBuild_CtrlDefine public Animator Anim; public RectTransform rectTransform; public override void Awake() { //UIAutoBuild_CtrlBind base.Awake(); Transform tf = transform; tmpTitle = tf.Find("BG/tmpTitle").GetComponent(); tmpSubTitle = tf.Find("BG/tmpSubTitle").GetComponent(); //UIAutoBuild_CtrlBind Anim = tf.GetComponent(); rectTransform = this.GetComponent(); } void OnEnable() { //UIAutoBuild_EventReg //UIAutoBuild_EventReg } void OnDisable() { //UIAutoBuild_EventUnReg //UIAutoBuild_EventUnReg } void Start() { } // 每次显示都执行, 可定义参数 public override void Show(params object[] _params) { base.Show(_params); tmpTitle.text = _params[0].ToString(); tmpSubTitle.text = _params[1].ToString(); Anim.Play("ShowScenesAnim"); Invoke("EndEff", Anim.GetCurrentAnimatorStateInfo(0).length); } public void EndEff() { this.gameObject.SetActive(false); } } }