76 lines
2.1 KiB
C#
76 lines
2.1 KiB
C#
/// <summary>
|
|
///********************************************************
|
|
/// 作者: DDG
|
|
/// 日期: 2024/12/13 11:54:37
|
|
/// 功能:
|
|
///********************************************************
|
|
/// <summary>
|
|
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using ZXKFramework;
|
|
|
|
namespace DongWuYiXue.DaoNiaoShu
|
|
{
|
|
public class PopPanel : UIBase
|
|
{
|
|
public override string GroupName => "PopPanel";
|
|
|
|
public override string Name => "PopPanel";
|
|
|
|
TextMeshProUGUI pop_Txt_1;
|
|
TextMeshProUGUI pop_Txt_1_2;
|
|
|
|
TextMeshProUGUI pop_Txt_2;
|
|
TextMeshProUGUI pop_Txt_2_2;
|
|
|
|
public override void Init(IUIManager uictrl)
|
|
{
|
|
base.Init(uictrl);
|
|
|
|
pop_Txt_1 = transform.FindFirst<TextMeshProUGUI>("PopTxt_1");
|
|
pop_Txt_1_2 = transform.FindFirst<TextMeshProUGUI>("PopTxt1_2");
|
|
|
|
pop_Txt_2 = transform.FindFirst<TextMeshProUGUI>("PopTxt_2");
|
|
pop_Txt_2_2 = transform.FindFirst<TextMeshProUGUI>("PopTxt2_2");
|
|
}
|
|
|
|
|
|
public override void ShowData(params object[] obj)
|
|
{
|
|
base.ShowData(obj);
|
|
if (obj.Length != 1) return;
|
|
if (System.Text.Encoding.UTF8.GetByteCount(obj[0].ToString()) >= 180)
|
|
{
|
|
pop_Txt_2.gameObject.SetActive(true);
|
|
pop_Txt_1.gameObject.SetActive(false);
|
|
pop_Txt_2.text = obj[0].ToString();
|
|
pop_Txt_2_2.text = obj[0].ToString();
|
|
}
|
|
else
|
|
{
|
|
pop_Txt_2.gameObject.SetActive(false);
|
|
pop_Txt_1.gameObject.SetActive(true);
|
|
pop_Txt_1.text = obj[0].ToString();
|
|
pop_Txt_1_2.text = obj[0].ToString();
|
|
}
|
|
|
|
}
|
|
|
|
IEnumerator Close()
|
|
{
|
|
yield return new WaitForSeconds(4);
|
|
SetActive(false);
|
|
}
|
|
|
|
public override void Show()
|
|
{
|
|
base.Show();
|
|
//StartCoroutine(Close());
|
|
}
|
|
}
|
|
}
|