69 lines
1.6 KiB
C#
69 lines
1.6 KiB
C#
![]() |
// ***********************************************************************
|
|||
|
// Assembly : Unity
|
|||
|
// Author : Kimch
|
|||
|
// Created :
|
|||
|
//
|
|||
|
// Last Modified By : Kimch
|
|||
|
// Last Modified On :
|
|||
|
// ***********************************************************************
|
|||
|
// <copyright file= "MessageBox.View" company=""></copyright>
|
|||
|
// <summary></summary>
|
|||
|
// ***********************************************************************
|
|||
|
using UnityEngine.UI;
|
|||
|
using Text = TMPro.TextMeshProUGUI;
|
|||
|
|
|||
|
namespace G.UI
|
|||
|
{
|
|||
|
partial class MessageBox
|
|||
|
{
|
|||
|
#region Field
|
|||
|
|
|||
|
#pragma warning disable CS0649 // 从未对字段赋值,字段将一直保持其默认值 null
|
|||
|
[KUIFlag]
|
|||
|
Text _tmpTitle;
|
|||
|
[KUIFlag]
|
|||
|
Text _tmpContent;
|
|||
|
[KUIFlag]
|
|||
|
Button _btnConfirm;
|
|||
|
[KUIFlag]
|
|||
|
Button _btnCancel;
|
|||
|
[KUIFlag]
|
|||
|
Text _tmpConfirm;
|
|||
|
[KUIFlag]
|
|||
|
Text _tmpCancel;
|
|||
|
[KUIFlag]
|
|||
|
Button _btnClose;
|
|||
|
#pragma warning restore CS0649 // 从未对字段赋值,字段将一直保持其默认值 null
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
#region Method
|
|||
|
|
|||
|
public void InitView()
|
|||
|
{
|
|||
|
SetViewData();
|
|||
|
|
|||
|
_btnConfirm.onClick.AddListener(this.OnConfirmClick);
|
|||
|
_btnCancel.onClick.AddListener(this.OnCancelClick);
|
|||
|
_btnClose.onClick.AddListener(this.OnCloseClick);
|
|||
|
}
|
|||
|
|
|||
|
public void RefreshView()
|
|||
|
{
|
|||
|
_tmpTitle.text = _messageData.title;
|
|||
|
_tmpContent.text = _messageData.content;
|
|||
|
|
|||
|
_btnConfirm.gameObject.SetActive(_messageData.onConfirm != null);
|
|||
|
_btnCancel.gameObject.SetActive(_messageData.onCancel != null);
|
|||
|
_btnClose.gameObject.SetActive(_messageData.onClose != null);
|
|||
|
|
|||
|
_tmpConfirm.text = _messageData.confirmText;
|
|||
|
_tmpCancel.text = _messageData.cancelText;
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
#endregion
|
|||
|
}
|
|||
|
}
|
|||
|
|