using TMPro;
using System;
using PhxhSDK;
using Gameplay;
using UnityEngine;
using UnityEngine.UI;
using System.Globalization;
using Cysharp.Threading.Tasks;
using System.Collections.Generic;
///
/// 公告UI
///
public class UI_NoticeController : UIWindow
{
///
/// 打开公告界面
///
public static async UniTask Open(int id = -1, E_NoticeType type = E_NoticeType.Activity)
{
CommonUtils.CaptureScreenshot();
InputData inputData = new()
{
OpenType = type,
Idx = id,
};
return await UIManager.Instance.CreateAndOpenWindow(UINameConst.UI_Notice, inputData);
}
private struct InputData
{
public E_NoticeType OpenType;
public int Idx;
}
#region 类
///
/// 公告类型
///
private class NoticeTypeTab : UIGameObjectWrapper
{
#region UI
///
/// 选中按钮
///
private Button buttonChoose;
///
/// 未选中按钮
///
private Button buttonNormal;
///
/// 公告类型
///
private readonly E_NoticeType noticeType;
///
/// 公告索引
///
private readonly int index;
///
/// 点击回调
///
private readonly Action clickAction;
///
/// 选中红点
///
private RedPointUIController redPointChoose;
///
/// 未选中红点
///
private RedPointUIController redPointNormal;
#endregion
///
/// 是否选中
///
public bool IsSelect
{
set
{
buttonChoose.gameObject.IsScaleShow(value);
buttonNormal.gameObject.IsScaleShow(!value);
}
}
public NoticeTypeTab(GameObject root, E_NoticeType noticeType, Action click) : base(root, true)
{
this.noticeType = noticeType;
clickAction = click;
buttonChoose = GetComponent