55 lines
1.4 KiB
C#
55 lines
1.4 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using TMPro;
|
|
using System;
|
|
|
|
public class ConfirmPanel : PanelBasic
|
|
{
|
|
public Button cancle_button;
|
|
public Button confirm_button;
|
|
|
|
public TextMeshProUGUI tittle_text;
|
|
public TextMeshProUGUI prompt_content_text;
|
|
public TextMeshProUGUI confirm_content_text;
|
|
|
|
protected override void Awake()
|
|
{
|
|
base.Awake();
|
|
transform.SetAsLastSibling();
|
|
}
|
|
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
cancle_button.onClick.AddListener(OnCancale);
|
|
confirm_button.onClick.AddListener(OnConfirm);
|
|
}
|
|
|
|
/// <summary>
|
|
/// µ¯´°
|
|
/// </summary>
|
|
/// <param name="_prompt_content">ÌáʾÄÚÈÝ</param>
|
|
/// <param name="_confirm_content_text">È·ÈÏÄÚÈÝ</param>
|
|
/// <param name="_tittle"></param>
|
|
/// <param name="_callback"></param>
|
|
public void OnPopup(string _prompt_content, string _confirm_content_text, string _tittle = "Ìáʾ", Action<bool> _callback = null)
|
|
{
|
|
base.OnPopup(_callback);
|
|
tittle_text.text = _tittle;
|
|
confirm_content_text.text = _confirm_content_text;
|
|
prompt_content_text.text = _prompt_content;
|
|
}
|
|
|
|
public void OnCancale()
|
|
{
|
|
OnPopupEnd(false);
|
|
}
|
|
|
|
public void OnConfirm()
|
|
{
|
|
OnPopupEnd(true);
|
|
}
|
|
}
|