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.
|
|
|
using System;
|
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
using UnityEngine.UI;
|
|
|
|
using AX.NetworkSystem;
|
|
|
|
using AX.MessageSystem;
|
|
|
|
|
|
|
|
public class MessagePanel : MonoBehaviour {
|
|
|
|
|
|
|
|
public Text ShowText;
|
|
|
|
public Button SureButton;
|
|
|
|
public Button CancelButton;
|
|
|
|
|
|
|
|
public Action SureAction;
|
|
|
|
|
|
|
|
|
|
|
|
void Start()
|
|
|
|
{
|
|
|
|
SureButton.onClick.AddListener(SureButtonClick);
|
|
|
|
CancelButton.onClick.AddListener(CancelButtonClick);
|
|
|
|
}
|
|
|
|
|
|
|
|
private void CancelButtonClick()
|
|
|
|
{
|
|
|
|
ShowText.text = "";
|
|
|
|
SureAction = null;
|
|
|
|
gameObject.SetActive(false);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 显示提示框
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="str">显示文本</param>
|
|
|
|
public void MessageBoxShow(string str)
|
|
|
|
{
|
|
|
|
ShowText.text = str;
|
|
|
|
gameObject.SetActive(true);
|
|
|
|
Debug.Log(22);
|
|
|
|
}
|
|
|
|
|
|
|
|
//确定按钮
|
|
|
|
private void SureButtonClick()
|
|
|
|
{
|
|
|
|
if (SureAction != null)
|
|
|
|
{
|
|
|
|
SureAction.Invoke();
|
|
|
|
}
|
|
|
|
ShowText.text = "";
|
|
|
|
SureAction = null;
|
|
|
|
gameObject.SetActive(false);
|
|
|
|
}
|
|
|
|
}
|