Files
Zombie/Assets/Plugins/XPlugins/XUI/UIStack/Test/ActivePanelDialog.cs

34 lines
1.1 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using UnityEngine;
using UnityEngine.UI;
using XUI;
public class ActivePanelDialog : UIBehaviour {
public static void Show(int score,string playerName,GameObject go) {
var stack = FindObjectOfType<UIStackTest>();
stack.Overlay(new[] {stack.Black, stack.Dialog},score,playerName,go);
}
void Awake() {
this.GetComponentInChildren<Text>().text = "id:" + Random.Range(0, 100);//通过给一个id测试被覆盖的界面恢复时状态仍然正确
}
public override void OnUIShow(params object[] args) {
int score = (int) args[0];
string name = (string) args[1];
Debug.Log("对话款出现了,得分是"+score);
}
public void OnUIShowArgs(int score,string playerName,GameObject go) {
Debug.LogWarning(" 活动对话框显示了 参数是 "+score+playerName+go);
}
public override void OnUIPause(bool cover) {
base.OnUIPause(cover);
if (cover) {
Debug.LogWarning("活动界面被覆盖了");
} else {
Debug.LogWarning("活动界面被叠加了");
}
}
}