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.

57 lines
1.3 KiB

1 year ago
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using XWFramework.UI;
using System;
using UnityEngine.UI;
namespace Level1
{
public class ToolPanel : UIPanel
{
public GameObject errorTip;
public GameObject tip;
protected override void Awake()
{
type = UIType.Tool;
base.Awake();
}
protected override void Init()
{
errorTip.SetActive(false);
tip.SetActive(false);
}
#region ErrotTip
public ToolPanel ChangeErrorTip(string content) {
errorTip.SetActive(true);
errorTip.GetComponent<ErrorTip>().ChangeText(content);
errorTip.SetActive(false);
return this;
}
public void ShowErrorTip(float t=2.5f) {
errorTip.SetActive(true);
errorTip.GetComponent<ErrorTip>().Show(t);
}
#endregion
#region Tip
public ToolPanel ChangeTip(string content)
{
tip.SetActive(true);
tip.GetComponent<Tip>().ChangeText(content);
tip.SetActive(false);
return this;
}
public void ShowTip()
{
tip.SetActive(true);
tip.GetComponent<Tip>().Show();
}
#endregion
}
}