You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 lines
1.7 KiB

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using LzFramework.UI;
using System;
namespace DisComputer
{
public class SpareDetailInfoView : TTUIPage
{
public SpareDetailInfoView() : base(UIType.PopUp, UIMode.DoNothing, UICollider.None)
{
uiPath = "UIPrefabs/SpareDetailInfoView";
}
//元件标题
private Text title_txt;
//元件信息
private Text info_txt;
//关闭按钮
private Button close_btn;
public override void Awake(GameObject go)
{
title_txt = this.transform.Find("Text_title").gameObject.GetComponent<Text>();
info_txt = this.transform.Find("Text_info").gameObject.GetComponent<Text>();
close_btn = this.transform.Find("Button_close").gameObject.GetComponent<Button>();
close_btn.onClick.AddListener(()=>
{
Hide();
});
}
public override void Active()
{
SpareDetailData spareDetailData = (SpareDetailData)data;
title_txt.text = spareDetailData.title_str;
info_txt.text = spareDetailData.info_str.Replace('$', '\n');
this.gameObject.SetActive(true);
}
public override void Hide()
{
this.gameObject.SetActive(false);
title_txt.text = " ";
info_txt.text = " ";
}
public override void Refresh()
{
}
}
[Serializable]
public class SpareDetailData {
public SpareType spareType;
public string title_str;
public string info_str;
}
}