贺州人民医院电子沙盘
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.
 
 
 
 

72 lines
3.3 KiB

using UnityEngine;
using AX.DevelopEngine;
using UnityEngine.Events;
using UnityEngine.UI;
public class ResourceLoadWindow : MonoSingleton<ResourceLoadWindow>
{
private ResourceLoadWindow() { }
/// <summary>
/// 加载文本提示框
/// </summary>
/// <param name="hintText">提示文本</param>
/// <param name="stayTime">停留时间</param>
public void LoadTextHintWindow(string hintText, float stayTime)
{
//如果前一个提示窗口还未关闭,提前销毁
if (GameObject.Find("HintTextWindow"))
DestroyImmediate(GameObject.Find("HintTextWindow"));
GameObject prefab = Instantiate(Resources.Load("UI/TextHintWindow"),GameObject.Find("Canvas").transform) as GameObject;
prefab.GetComponent<TextHintWindowManager>().SetWindow(hintText, stayTime);
}
/// <summary>
/// 加载确认信息提示框
/// </summary>
/// <param name="tips">提示文本</param>
/// <param name="OKFunction">确认调用的方法</param>
/// <param name="NOFunction">取消调用的方法</param>
public void LoadTipWindow(string tips, UnityAction OKFunction, UnityAction NOFunction)
{
if (GameObject.Find("Canvas").transform.Find("TheTipWindow"))
return;
GameObject prefab = Instantiate(Resources.Load("UI/TipWindow"),GameObject.Find("Canvas").transform) as GameObject;
prefab.GetComponent<TipWindowManager>().SetWindow(tips, OKFunction, NOFunction);
}
/// <summary>
/// 加载可以输入信息提示框
/// </summary>
/// <param name="tips">提示文本</param>
/// <param name="OKFunction">确认调用的方法</param>
/// <param name="NOFunction">取消调用的方法</param>
public void LoadInputWindow(string tips, UnityAction<string> OKFunction, UnityAction NOFunction, string Intro)
{
if (GameObject.Find("Canvas").transform.Find("TheInputWindow"))
return;
GameObject prefab = Instantiate(Resources.Load("UI/TheInputWindow"), GameObject.Find("Canvas").transform) as GameObject;
prefab.GetComponent<InputWindowManager>().SetWindow(tips, OKFunction, NOFunction);
prefab.name = "TheInputWindow";
prefab.transform.Find("InputField").GetComponent<InputField>().text = Intro;
}
public GameObject LoadProgressWindow(string tips, float DurationTime, UnityAction CompleteFunction)
{
GameObject prefab = Instantiate(Resources.Load("UI/ProgressPanel")) as GameObject;
prefab.GetComponent<ProgressManage>().SetWindow(tips, DurationTime, CompleteFunction);
prefab.name = "ProgressPanel";
return prefab;
}
/// <summary>
/// 加载确认信息提示框
/// </summary>
/// <param name="tips">提示文本</param>
/// <param name="OKFunction">确认调用的方法</param>
/// <param name="NOFunction">取消调用的方法</param>
public void LoadUpdateTipWindow(string tips, UnityAction OKFunction, UnityAction NOFunction)
{
if (GameObject.Find("Canvas").transform.Find("UpdateTipWindow"))
return;
GameObject prefab = Instantiate(Resources.Load("UI/UpdateTipWindow"), GameObject.Find("Canvas").transform) as GameObject;
prefab.GetComponent<UpdateTipWindowManager>().SetWindow(tips, OKFunction, NOFunction);
}
}