34 lines
1.1 KiB
C#
34 lines
1.1 KiB
C#
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("活动界面被叠加了");
|
||
}
|
||
}
|
||
} |