|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
using UnityEngine.Events;
|
|
|
|
|
|
|
|
public class LoadPromptWin : PromptWinSingleton<LoadPromptWin>
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// 纯文本提示窗,没有确定取消等其他操作
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="promptContent">提示信息内容</param>
|
|
|
|
/// <param name="stayTime">提示窗口停留时间</param>
|
|
|
|
public void LoadTextPromptWindow(string promptContent, float stayTime)
|
|
|
|
{
|
|
|
|
//如果前一个提示窗口还未关闭,提前销毁
|
|
|
|
if (GameObject.Find("OnlyTextPromptWin"))
|
|
|
|
DestroyImmediate(GameObject.Find("OnlyTextPromptWin"));
|
|
|
|
|
|
|
|
GameObject textPromptWin = Instantiate(Resources.Load("Common/OnlyTextPromptWin")) as GameObject;
|
|
|
|
textPromptWin.name = "OnlyTextPromptWin";
|
|
|
|
textPromptWin.GetComponent<OnlyTextPromptWin>().SetWindow(promptContent, stayTime);
|
|
|
|
}
|
|
|
|
public void LoadFailTextPromptWindow(string failContent, float stayTime)
|
|
|
|
{
|
|
|
|
if (GameObject.Find("VictoryPromptWin"))
|
|
|
|
DestroyImmediate(GameObject.Find("VictoryPromptWin"));
|
|
|
|
GameObject textPromptWin = Instantiate(Resources.Load("Common/VictoryPromptWin")) as GameObject;
|
|
|
|
textPromptWin.name = "VictoryPromptWin";
|
|
|
|
textPromptWin.GetComponent<VictoryPromptWin>().SetWindow(failContent, stayTime);
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
|
|
/// 带“确定”、“取消”按钮的提示窗口
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="tips">提示信息内容</param>
|
|
|
|
/// <param name="sureFunc">提示窗口确定</param>
|
|
|
|
/// <param name="CancelFunc">提示窗口取消</param>
|
|
|
|
public void LoadTipWindow(string tips, UnityAction sureFunc, UnityAction CancelFunc)
|
|
|
|
{
|
|
|
|
if (GameObject.Find("Canvas").transform.Find("TipWindow"))
|
|
|
|
return;
|
|
|
|
GameObject tipWin = Instantiate(Resources.Load("Common/TipWindow")) as GameObject;
|
|
|
|
tipWin.name = "TipWindow";
|
|
|
|
tipWin.GetComponent<TipWindowManager>().SetWindow(tips, sureFunc, CancelFunc);
|
|
|
|
}
|
|
|
|
public void LoadTipWindowNoButton(string tips,float stayTime)
|
|
|
|
{
|
|
|
|
if (GameObject.Find("TipWindowNoBtton"))
|
|
|
|
DestroyImmediate(GameObject.Find("TipWindowNoBtton"));
|
|
|
|
|
|
|
|
GameObject textPromptWin = Instantiate(Resources.Load("Common/TipWindowNoButton")) as GameObject;
|
|
|
|
textPromptWin.name = "OnlyTextPromptWin";
|
|
|
|
// textPromptWin.transform.SetAsLastSibling();
|
|
|
|
textPromptWin.GetComponent<OnlyTextPromptWin>().SetNoButtonWindow(tips, stayTime);
|
|
|
|
}
|
|
|
|
}
|