95 lines
1.9 KiB
C#
95 lines
1.9 KiB
C#
// ***********************************************************************
|
|
// Assembly : Game
|
|
// Author : Kimch
|
|
// Created : 2021-04-04
|
|
// Description :
|
|
// Last Modified By :
|
|
// Last Modified On :
|
|
// ***********************************************************************
|
|
// <copyright file= "MailWindow.View" company="Kunpo"></copyright>
|
|
// <summary></summary>
|
|
// ***********************************************************************
|
|
namespace G.UI
|
|
{
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
partial class MailWindow
|
|
{
|
|
#region Field
|
|
|
|
#pragma warning disable CS0649 // 从未对字段赋值,字段将一直保持其默认值 null
|
|
[KUIFlag]
|
|
Button _btnClose;
|
|
[KUIFlag]
|
|
MailListWidget __goMailList;
|
|
[KUIFlag]
|
|
MailDetailWidget __goMailDetail;
|
|
#pragma warning restore CS0649 // 从未对字段赋值,字段将一直保持其默认值 null
|
|
|
|
#endregion
|
|
|
|
#region Method
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
public void InitView()
|
|
{
|
|
SetViewData();
|
|
_btnClose.onClick.AddListener(this.OnCloseBtnClick);
|
|
}
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
public void RefreshView()
|
|
{
|
|
__goMailDetail.gameObject.SetActive(false);
|
|
ShowMailList(null);
|
|
}
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
public void UpdateView()
|
|
{
|
|
}
|
|
|
|
private void OnCloseBtnClick()
|
|
{
|
|
if (__goMailDetail.gameObject.activeSelf)
|
|
{
|
|
RefreshView();
|
|
}
|
|
else
|
|
CloseWindow(this);
|
|
}
|
|
|
|
private void ShowMailList(IList<Mail> mails)
|
|
{
|
|
__goMailList.gameObject.SetActive(true);
|
|
__goMailList.SetData(mails);
|
|
}
|
|
|
|
private void HideMailList()
|
|
{
|
|
__goMailList.gameObject.SetActive(false);
|
|
}
|
|
|
|
private void ShowMailDetail(Mail mail)
|
|
{
|
|
__goMailList.gameObject.SetActive(false);
|
|
|
|
__goMailDetail.gameObject.SetActive(true);
|
|
__goMailDetail.SetData(mail);
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
}
|