main
parent
306be0b17d
commit
9e91bee9ba
|
|
@ -49,7 +49,7 @@ Material:
|
|||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MainTex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Texture: {fileID: 2800000, guid: 3e9da05008ae0824482735c816e6183f, type: 3}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MetallicGlossMap:
|
||||
|
|
|
|||
BIN
ProjectNLD/Assets/Art/UI/Fonts/SourceHanSansCN-Medium SDF.asset (Stored with Git LFS)
BIN
ProjectNLD/Assets/Art/UI/Fonts/SourceHanSansCN-Medium SDF.asset (Stored with Git LFS)
Binary file not shown.
|
|
@ -28,7 +28,7 @@ Material:
|
|||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MainTex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Texture: {fileID: 2800000, guid: e55d15c9c1f1ea247992163ab706af57, type: 3}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Ints: []
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -1699,6 +1699,7 @@ GameObject:
|
|||
- component: {fileID: 8914029981712386510}
|
||||
- component: {fileID: 2318030641902475784}
|
||||
- component: {fileID: 72534846515749784}
|
||||
- component: {fileID: 6821684948598729752}
|
||||
m_Layer: 5
|
||||
m_Name: Cell
|
||||
m_TagString: Untagged
|
||||
|
|
@ -1763,6 +1764,50 @@ MonoBehaviour:
|
|||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!114 &6821684948598729752
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2279322391809963358}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Navigation:
|
||||
m_Mode: 3
|
||||
m_WrapAround: 0
|
||||
m_SelectOnUp: {fileID: 0}
|
||||
m_SelectOnDown: {fileID: 0}
|
||||
m_SelectOnLeft: {fileID: 0}
|
||||
m_SelectOnRight: {fileID: 0}
|
||||
m_Transition: 1
|
||||
m_Colors:
|
||||
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
|
||||
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
|
||||
m_ColorMultiplier: 1
|
||||
m_FadeDuration: 0.1
|
||||
m_SpriteState:
|
||||
m_HighlightedSprite: {fileID: 0}
|
||||
m_PressedSprite: {fileID: 0}
|
||||
m_SelectedSprite: {fileID: 0}
|
||||
m_DisabledSprite: {fileID: 0}
|
||||
m_AnimationTriggers:
|
||||
m_NormalTrigger: Normal
|
||||
m_HighlightedTrigger: Highlighted
|
||||
m_PressedTrigger: Pressed
|
||||
m_SelectedTrigger: Selected
|
||||
m_DisabledTrigger: Disabled
|
||||
m_Interactable: 1
|
||||
m_TargetGraphic: {fileID: 72534846515749784}
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
--- !u!1 &2306871806338842256
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ TextureImporter:
|
|||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteBorder: {x: 361, y: 232, z: 357, w: 241}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
|
|
@ -139,7 +139,7 @@ TextureImporter:
|
|||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
internalID: 1537655665
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
|
|
|
|||
|
|
@ -12,31 +12,7 @@ public class UI_NoticeBinder
|
|||
|
||||
public static void GetComponents(UI_NoticeController window)
|
||||
{
|
||||
window.Image_NoticeBG = window.GetComponent<Image>("Image_NoticeBG");
|
||||
window.Button_Close = window.GetComponent<Button>("Image_NoticeBG/Button_Close");
|
||||
window.Button_LeftPressed = window.GetComponent<Button>("Image_NoticeBG/Button_LeftPressed");
|
||||
window.Button_RightPressed = window.GetComponent<Button>("Image_NoticeBG/Button_RightPressed");
|
||||
window.Image_NoticeTextBG = window.GetComponent<Image>("Image_NoticeBG/Image_NoticeTextBG");
|
||||
window.Image_ActivityPic = window.GetComponent<Image>("Image_NoticeBG/Image_NoticeTextBG/Image_ActivityPic");
|
||||
window.Text_ActivityName = window.GetComponent<TMP_Text>("Image_NoticeBG/Image_NoticeTextBG/Image_ActivityPic/Text_ActivityName");
|
||||
window.Text_ActivityInfo = window.GetComponent<TMP_Text>("Image_NoticeBG/Image_NoticeTextBG/Image_ActivityPic/Text_ActivityInfo");
|
||||
window.Button_PressedDown = window.GetComponent<Button>("Image_NoticeBG/Scroll View/Viewport/Content/Button_ActivityTitle01/Button_PressedDown");
|
||||
window.Button_UnPressed = window.GetComponent<Button>("Image_NoticeBG/Scroll View/Viewport/Content/Button_ActivityTitle01/Button_UnPressed");
|
||||
window.Button_PressedDown02 = window.GetComponent<Button>("Image_NoticeBG/Scroll View/Viewport/Content/Button_ActivityTitle02/Button_PressedDown02");
|
||||
window.Button_UnPressed02 = window.GetComponent<Button>("Image_NoticeBG/Scroll View/Viewport/Content/Button_ActivityTitle02/Button_UnPressed02");
|
||||
window.Button_PressedDown03 = window.GetComponent<Button>("Image_NoticeBG/Scroll View/Viewport/Content/Button_ActivityTitle03/Button_PressedDown03");
|
||||
window.Button_UnPressed03 = window.GetComponent<Button>("Image_NoticeBG/Scroll View/Viewport/Content/Button_ActivityTitle03/Button_UnPressed03");
|
||||
window.Button_PressedDown04 = window.GetComponent<Button>("Image_NoticeBG/Scroll View/Viewport/Content/Button_ActivityTitle04/Button_PressedDown04");
|
||||
window.Button_UnPressed04 = window.GetComponent<Button>("Image_NoticeBG/Scroll View/Viewport/Content/Button_ActivityTitle04/Button_UnPressed04");
|
||||
window.Button_PressedDown05 = window.GetComponent<Button>("Image_NoticeBG/Scroll View/Viewport/Content/Button_ActivityTitle05/Button_PressedDown05");
|
||||
window.Button_UnPressed05 = window.GetComponent<Button>("Image_NoticeBG/Scroll View/Viewport/Content/Button_ActivityTitle05/Button_UnPressed05");
|
||||
window.Button_PressedDown06 = window.GetComponent<Button>("Image_NoticeBG/Scroll View/Viewport/Content/Button_ActivityTitle06/Button_PressedDown06");
|
||||
window.Button_UnPressed06 = window.GetComponent<Button>("Image_NoticeBG/Scroll View/Viewport/Content/Button_ActivityTitle06/Button_UnPressed06");
|
||||
window.Button_PressedDown07 = window.GetComponent<Button>("Image_NoticeBG/Scroll View/Viewport/Content/Button_ActivityTitle07/Button_PressedDown07");
|
||||
window.Button_UnPressed07 = window.GetComponent<Button>("Image_NoticeBG/Scroll View/Viewport/Content/Button_ActivityTitle07/Button_UnPressed07");
|
||||
window.Button_PressedDown08 = window.GetComponent<Button>("Image_NoticeBG/Scroll View/Viewport/Content/Button_ActivityTitle08/Button_PressedDown08");
|
||||
window.Button_UnPressed08 = window.GetComponent<Button>("Image_NoticeBG/Scroll View/Viewport/Content/Button_ActivityTitle08/Button_UnPressed08");
|
||||
|
||||
|
||||
}
|
||||
|
||||
/****** 定义变量语句 ******
|
||||
|
|
|
|||
|
|
@ -256,9 +256,9 @@ public class UI_MainPanelController : UIWindow
|
|||
textName = GetComponent<TMP_Text>("Image_ActorLineBG/Text_Name");
|
||||
textContent = GetComponent<TMP_Text>("Image_ActorLineBG/Text_Describe");
|
||||
|
||||
buttonKanbanban.onClick.AddListener(() => { OnKanbanban(true); });
|
||||
buttonClose.onClick.AddListener(() => { OnKanbanban(false); });
|
||||
buttonVoice.onClick.AddListener(OnVoice);
|
||||
BindButton(buttonKanbanban, () => { OnKanbanban(true); });
|
||||
BindButton(buttonClose, () => { OnKanbanban(false); });
|
||||
BindButton(buttonVoice, OnVoice);
|
||||
|
||||
IsShowContent = false;
|
||||
}
|
||||
|
|
@ -320,14 +320,35 @@ public class UI_MainPanelController : UIWindow
|
|||
/// </summary>
|
||||
private class BannerItem : UIGameObjectWrapper
|
||||
{
|
||||
private Button buttonBanner;
|
||||
|
||||
public BannerItem(GameObject root) : base(root, true)
|
||||
{
|
||||
Construct();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 复制
|
||||
/// </summary>
|
||||
/// <param name="root"></param>
|
||||
/// <param name="i"></param>
|
||||
public BannerItem(GameObject root, int i) : base(root, i, true)
|
||||
{
|
||||
Construct();
|
||||
}
|
||||
|
||||
private void Construct()
|
||||
{
|
||||
buttonBanner = GoRoot.GetComponent<Button>();
|
||||
|
||||
BindButton(buttonBanner, OnClick);
|
||||
|
||||
IsActive = true;
|
||||
}
|
||||
|
||||
public BannerItem(GameObject root, int i) : base(root, i, true)
|
||||
private async void OnClick()
|
||||
{
|
||||
IsActive = true;
|
||||
await UIManager.Instance.OpenWindow(UINameConst.UI_Notice);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -634,21 +655,21 @@ public class UI_MainPanelController : UIWindow
|
|||
musicDance = new(FindObj("DownBG/Music/MusicAnalyzers"));
|
||||
kanbanban = new(FindObj("Button_CharacterPoster"));
|
||||
|
||||
buttonCamera.onClick.AddListener(OnCameraChange);
|
||||
buttonCharacterChange.onClick.AddListener(OnCameraOrCharacterChange);
|
||||
buttonRaffle.onClick.AddListener(OnRaffle);
|
||||
buttonStore.onClick.AddListener(OnStore);
|
||||
buttonCharacter.onClick.AddListener(OnCharacter);
|
||||
buttonTeam.onClick.AddListener(OnTeam);
|
||||
buttonVehicle.onClick.AddListener(OnVehicle);
|
||||
buttonCamp.onClick.AddListener(OnCamp);
|
||||
buttonChooseLevel.onClick.AddListener(OnChooseLevel);
|
||||
buttonPVP.onClick.AddListener(OnPVP);
|
||||
buttonPlusP.onClick.AddListener(OnPlusP);
|
||||
buttonNotice.onClick.AddListener(OnNotice);
|
||||
buttonEmail.onClick.AddListener(OnEmail);
|
||||
buttonSetting.onClick.AddListener(OnSetting);
|
||||
buttonMission.onClick.AddListener(OnTask);
|
||||
BindButton(buttonCamera, OnCameraChange);
|
||||
BindButton(buttonCharacterChange, OnCameraOrCharacterChange);
|
||||
BindButton(buttonRaffle, OnRaffle);
|
||||
BindButton(buttonStore, OnStore);
|
||||
BindButton(buttonCharacter, OnCharacter);
|
||||
BindButton(buttonTeam, OnTeam);
|
||||
BindButton(buttonVehicle, OnVehicle);
|
||||
BindButton(buttonCamp, OnCamp);
|
||||
BindButton(buttonChooseLevel, OnChooseLevel);
|
||||
BindButton(buttonPVP, OnPVP);
|
||||
BindButton(buttonPlusP, OnPlusP);
|
||||
BindButton(buttonNotice, OnNotice);
|
||||
BindButton(buttonEmail, OnEmail);
|
||||
BindButton(buttonSetting, OnSetting);
|
||||
BindButton(buttonMission, OnTask);
|
||||
|
||||
analyzer = new(NewAnalyzerConfig());
|
||||
spectrums = new float[SPECTRUM_SAMPLES_NUMBER];
|
||||
|
|
|
|||
|
|
@ -1,60 +1,404 @@
|
|||
using cfg.ActorCfg;
|
||||
using cfg.UIInterfaceBannerGoToCfg;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using Framework;
|
||||
using Gameplay.Net;
|
||||
using PhxhSDK;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using TMPro;
|
||||
using Button = UnityEngine.UI.Button;
|
||||
using Image = UnityEngine.UI.Image;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
/// <summary>
|
||||
/// 公告UI
|
||||
/// </summary>
|
||||
public class UI_NoticeController : UIWindow
|
||||
{
|
||||
//UI GameObj
|
||||
///Auto Gen Start///
|
||||
public Image Image_NoticeBG;
|
||||
public Button Button_Close;
|
||||
public Button Button_LeftPressed;
|
||||
public Button Button_RightPressed;
|
||||
public Image Image_NoticeTextBG;
|
||||
public Image Image_ActivityPic;
|
||||
public TMP_Text Text_ActivityName;
|
||||
public TMP_Text Text_ActivityInfo;
|
||||
public Button Button_PressedDown;
|
||||
public Button Button_UnPressed;
|
||||
public Button Button_PressedDown02;
|
||||
public Button Button_UnPressed02;
|
||||
public Button Button_PressedDown03;
|
||||
public Button Button_UnPressed03;
|
||||
public Button Button_PressedDown04;
|
||||
public Button Button_UnPressed04;
|
||||
public Button Button_PressedDown05;
|
||||
public Button Button_UnPressed05;
|
||||
public Button Button_PressedDown06;
|
||||
public Button Button_UnPressed06;
|
||||
public Button Button_PressedDown07;
|
||||
public Button Button_UnPressed07;
|
||||
public Button Button_PressedDown08;
|
||||
public Button Button_UnPressed08;
|
||||
|
||||
///Auto Gen End///
|
||||
|
||||
// Use this for initialization
|
||||
/// <summary>
|
||||
/// 打开公告界面
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static async UniTask<UIWindow> Open()
|
||||
{
|
||||
return await UIManager.Instance.OpenWindow(UINameConst.UI_Notice);
|
||||
}
|
||||
|
||||
#region Temp 临时
|
||||
/// <summary>
|
||||
/// 公告类型
|
||||
/// </summary>
|
||||
public enum E_NoticeType
|
||||
{
|
||||
None = 0,
|
||||
/// <summary>
|
||||
/// 活动
|
||||
/// </summary>
|
||||
Activity = 1,
|
||||
/// <summary>
|
||||
/// 系统
|
||||
/// </summary>
|
||||
System = 2,
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 类
|
||||
/// <summary>
|
||||
/// 公告类型页签
|
||||
/// </summary>
|
||||
private class NoticeTypeTab : UIGameObjectWrapper
|
||||
{
|
||||
/// <summary>
|
||||
/// 选中按钮
|
||||
/// </summary>
|
||||
private Button buttonChoose;
|
||||
/// <summary>
|
||||
/// 未选中按钮
|
||||
/// </summary>
|
||||
private Button buttonNormal;
|
||||
|
||||
/// <summary>
|
||||
/// 公告类型
|
||||
/// </summary>
|
||||
private readonly E_NoticeType noticeType;
|
||||
/// <summary>
|
||||
/// 点击回调
|
||||
/// </summary>
|
||||
private readonly Action<E_NoticeType> clickAction;
|
||||
|
||||
/// <summary>
|
||||
/// 是否选中
|
||||
/// </summary>
|
||||
public bool IsSelect
|
||||
{
|
||||
set
|
||||
{
|
||||
buttonChoose.gameObject.IsScaleShow(value);
|
||||
buttonNormal.gameObject.IsScaleShow(!value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 公告类型
|
||||
/// </summary>
|
||||
public E_NoticeType NoticeType
|
||||
{
|
||||
get { return noticeType; }
|
||||
}
|
||||
|
||||
public NoticeTypeTab(GameObject root, E_NoticeType noticeType, Action<E_NoticeType> click) : base(root, true)
|
||||
{
|
||||
this.noticeType = noticeType;
|
||||
clickAction = click;
|
||||
|
||||
buttonChoose = GetComponent<Button>("ButtonChoose");
|
||||
buttonNormal = GetComponent<Button>("ButtonNormal");
|
||||
|
||||
buttonChoose.onClick.AddListener(OnClick);
|
||||
buttonNormal.onClick.AddListener(OnClick);
|
||||
}
|
||||
|
||||
private void OnClick()
|
||||
{
|
||||
clickAction?.Invoke(noticeType);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 公告页签
|
||||
/// </summary>
|
||||
private class NoticeTab : UIGameObjectWrapper
|
||||
{
|
||||
#region UI
|
||||
/// <summary>
|
||||
/// 选中状态按钮
|
||||
/// </summary>
|
||||
private Button buttonChoose;
|
||||
/// <summary>
|
||||
/// 非选中状态按钮
|
||||
/// </summary>
|
||||
private Button buttonNormal;
|
||||
/// <summary>
|
||||
/// 选中状态标题
|
||||
/// </summary>
|
||||
private TMP_Text textSelectTitle;
|
||||
/// <summary>
|
||||
/// 选中状态日
|
||||
/// </summary>
|
||||
private TMP_Text textSelectDay;
|
||||
/// <summary>
|
||||
/// 选中状态月
|
||||
/// </summary>
|
||||
private TMP_Text textSelectWeek;
|
||||
/// <summary>
|
||||
/// 选中状态星期
|
||||
/// </summary>
|
||||
private TMP_Text textSelectMonth;
|
||||
/// <summary>
|
||||
/// 未选中状态标题
|
||||
/// </summary>
|
||||
private TMP_Text textTitle;
|
||||
/// <summary>
|
||||
/// 未选中状态日
|
||||
/// </summary>
|
||||
private TMP_Text textDay;
|
||||
/// <summary>
|
||||
/// 未选中状态月
|
||||
/// </summary>
|
||||
private TMP_Text textWeek;
|
||||
/// <summary>
|
||||
/// 未选中状态星期
|
||||
/// </summary>
|
||||
private TMP_Text textMonth;
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 选中回调
|
||||
/// </summary>
|
||||
private readonly Action<NoticeTab> selectAction;
|
||||
private DataUIBanner uiBanner;
|
||||
|
||||
/// <summary>
|
||||
/// 是否选中
|
||||
/// </summary>
|
||||
public bool IsSelect
|
||||
{
|
||||
set
|
||||
{
|
||||
buttonChoose.gameObject.IsScaleShow(value);
|
||||
buttonNormal.gameObject.IsScaleShow(!value);
|
||||
}
|
||||
}
|
||||
|
||||
public int ID
|
||||
{
|
||||
get { return uiBanner.Index; }
|
||||
}
|
||||
|
||||
public DataUIBanner UIBanner
|
||||
{
|
||||
get { return uiBanner; }
|
||||
}
|
||||
|
||||
public NoticeTab(GameObject root, Action<NoticeTab> select) : base(root)
|
||||
{
|
||||
selectAction = select;
|
||||
|
||||
buttonChoose = GetComponent<Button>("ButtonChoose");
|
||||
buttonNormal = GetComponent<Button>("ButtonNormal");
|
||||
textSelectTitle = GetComponent<TMP_Text>("ButtonChoose/TextTitle");
|
||||
textSelectDay = GetComponent<TMP_Text>("ButtonChoose/TextDay");
|
||||
textSelectWeek = GetComponent<TMP_Text>("ButtonChoose/TextWeek");
|
||||
textSelectMonth = GetComponent<TMP_Text>("ButtonChoose/TextMonth");
|
||||
textTitle = GetComponent<TMP_Text>("ButtonNormal/TextTitle");
|
||||
textDay = GetComponent<TMP_Text>("ButtonNormal/TextDay");
|
||||
textWeek = GetComponent<TMP_Text>("ButtonNormal/TextWeek");
|
||||
textMonth = GetComponent<TMP_Text>("ButtonNormal/TextMonth");
|
||||
|
||||
BindButton(buttonChoose, OnClick);
|
||||
BindButton(buttonNormal, OnClick);
|
||||
}
|
||||
|
||||
public void SetInfo(DataUIBanner dataUIBanner)
|
||||
{
|
||||
uiBanner = dataUIBanner;
|
||||
|
||||
IsScaleShow = true;
|
||||
}
|
||||
|
||||
private void OnClick()
|
||||
{
|
||||
selectAction?.Invoke(this);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 公告内容
|
||||
/// </summary>
|
||||
private class NoticeContent : UIGameObjectWrapper
|
||||
{
|
||||
/// <summary>
|
||||
/// 活动名
|
||||
/// </summary>
|
||||
private TMP_Text textActivityName;
|
||||
/// <summary>
|
||||
/// 内容
|
||||
/// </summary>
|
||||
private TMP_Text textContent;
|
||||
/// <summary>
|
||||
/// 横幅
|
||||
/// </summary>
|
||||
private Image imageBanner;
|
||||
|
||||
public NoticeContent(GameObject root) : base(root)
|
||||
{
|
||||
textActivityName = GetComponent<TMP_Text>("ImageTitle/TextActivityName");
|
||||
textContent = GetComponent<TMP_Text>("TextContent");
|
||||
imageBanner = GetComponent<Image>("ImageBanner");
|
||||
}
|
||||
|
||||
public async void SetInfo(DataUIBanner dataUIBanner)
|
||||
{
|
||||
imageBanner.sprite = await AssetManager.Instance.LoadAssetAsync<Sprite>(dataUIBanner.BannerImgPath);
|
||||
|
||||
IsScaleShow = true;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 关闭按钮
|
||||
/// </summary>
|
||||
private Button buttonClose;
|
||||
/// <summary>
|
||||
/// 页签循环列表
|
||||
/// </summary>
|
||||
private RecycleView tabRecycleView;
|
||||
|
||||
/// <summary>
|
||||
/// 公告类型页签字典
|
||||
/// </summary>
|
||||
private readonly Dictionary<E_NoticeType, NoticeTypeTab> dicNoticeTypeTab = new();
|
||||
/// <summary>
|
||||
/// 页签字典
|
||||
/// </summary>
|
||||
private readonly Dictionary<int, NoticeTab> dicNoticeTap = new();
|
||||
/// <summary>
|
||||
/// 页签内容
|
||||
/// </summary>
|
||||
private NoticeContent noticeContent;
|
||||
/// <summary>
|
||||
/// 当前选中的公告类型
|
||||
/// </summary>
|
||||
private E_NoticeType curSelectNoticeType = E_NoticeType.None;
|
||||
/// <summary>
|
||||
/// 当前选择的页签
|
||||
/// </summary>
|
||||
private NoticeTab curSelectTab;
|
||||
|
||||
public override void OnInit()
|
||||
{
|
||||
UI_NoticeBinder.GetComponents(this);
|
||||
BindButton(Button_Close, ClosePanel);
|
||||
buttonClose = GetComponent<Button>("Image_NoticeBG/Button_Close");
|
||||
tabRecycleView = GetComponent<RecycleView>("Image_NoticeBG/Tabs");
|
||||
|
||||
dicNoticeTypeTab.Add(E_NoticeType.Activity, new NoticeTypeTab(FindObj("Image_NoticeBG/Notices/ActivityNotice"), E_NoticeType.Activity, OnNoticeTypeTab));
|
||||
dicNoticeTypeTab.Add(E_NoticeType.System, new NoticeTypeTab(FindObj("Image_NoticeBG/Notices/SystemNotice"), E_NoticeType.System, OnNoticeTypeTab));
|
||||
|
||||
noticeContent = new(FindObj("Image_NoticeBG/ContentRoot/Viewport/Content"));
|
||||
|
||||
tabRecycleView.Init(OnRefreshTab);
|
||||
|
||||
BindButton(buttonClose, OnClose);
|
||||
}
|
||||
|
||||
private void ClosePanel()
|
||||
{
|
||||
CloseWindow();
|
||||
}
|
||||
|
||||
//invoke when open window
|
||||
protected override void OnShowWindow(object data = null)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//invoke when reload window
|
||||
protected override void OnReloadWindow(object data = null)
|
||||
OnNoticeTypeTab(E_NoticeType.Activity); // 默认选中活动公告
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取要显示的页签数量
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private int GetShowTabCount()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
return curSelectNoticeType switch
|
||||
{
|
||||
E_NoticeType.Activity => TableManager.Instance.Tables.bannerCfg.DataList.Count,
|
||||
E_NoticeType.System => 0,
|
||||
_ => 0,
|
||||
};
|
||||
}
|
||||
|
||||
#region 回调方法
|
||||
/// <summary>
|
||||
/// 刷新页签
|
||||
/// </summary>
|
||||
/// <param name="cell"></param>
|
||||
/// <param name="index"></param>
|
||||
private void OnRefreshTab(GameObject cell, int index)
|
||||
{
|
||||
if (!dicNoticeTap.TryGetValue(cell.GetInstanceID(), out NoticeTab noticeTab))
|
||||
{
|
||||
noticeTab = new NoticeTab(cell, OnNoticeTab);
|
||||
dicNoticeTap[cell.GetInstanceID()] = noticeTab;
|
||||
}
|
||||
|
||||
switch (curSelectNoticeType)
|
||||
{
|
||||
case E_NoticeType.Activity:
|
||||
{
|
||||
List<DataUIBanner> listDataUIBanner = TableManager.Instance.Tables.bannerCfg.DataList;
|
||||
if (listDataUIBanner == null)
|
||||
return;
|
||||
|
||||
if (listDataUIBanner.Count < 0 || index >= listDataUIBanner.Count)
|
||||
{
|
||||
DebugUtil.LogWarning("索引错误");
|
||||
return;
|
||||
}
|
||||
|
||||
noticeTab.SetInfo(listDataUIBanner[index]);
|
||||
if (curSelectTab == null) // 默认选中一个
|
||||
OnNoticeTab(noticeTab);
|
||||
else if (noticeTab.ID == curSelectTab.ID)
|
||||
OnNoticeTab(noticeTab);
|
||||
else
|
||||
noticeTab.IsSelect = false;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
noticeTab.IsSelect = false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 关闭
|
||||
/// </summary>
|
||||
private void OnClose()
|
||||
{
|
||||
CloseWindow();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 公告类型页签
|
||||
/// </summary>
|
||||
private void OnNoticeTypeTab(E_NoticeType noticeType)
|
||||
{
|
||||
if (curSelectNoticeType == noticeType)
|
||||
return;
|
||||
|
||||
if (dicNoticeTypeTab.TryGetValue(curSelectNoticeType, out NoticeTypeTab tab))
|
||||
tab.IsSelect = false;
|
||||
|
||||
curSelectNoticeType = noticeType;
|
||||
|
||||
if (dicNoticeTypeTab.TryGetValue(curSelectNoticeType, out tab))
|
||||
tab.IsSelect = true;
|
||||
|
||||
tabRecycleView.ShowList(GetShowTabCount());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 公告页签
|
||||
/// </summary>
|
||||
private void OnNoticeTab(NoticeTab tab)
|
||||
{
|
||||
if (curSelectTab != null)
|
||||
{
|
||||
if (curSelectTab.ID == tab.ID)
|
||||
return;
|
||||
|
||||
curSelectTab.IsSelect = false;
|
||||
}
|
||||
|
||||
curSelectTab = tab;
|
||||
curSelectTab.IsSelect = true;
|
||||
|
||||
noticeContent.SetInfo(curSelectTab.UIBanner);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
|
@ -15,6 +15,7 @@
|
|||
"com.unity.inputsystem": "1.7.0",
|
||||
"com.unity.mathematics": "1.2.6",
|
||||
"com.unity.memoryprofiler": "1.1.0",
|
||||
"com.unity.mobile.android-logcat": "1.3.2",
|
||||
"com.unity.nuget.newtonsoft-json": "3.2.1",
|
||||
"com.unity.profiling.core": "1.0.2",
|
||||
"com.unity.purchasing": "http://1.14.122.170:3000/liutao/lib_unity_purchase.git",
|
||||
|
|
|
|||
Loading…
Reference in New Issue