Game_NES 改名RomListMenuItem 更通用

This commit is contained in:
ALIENJACK\alien 2024-09-12 11:34:32 +08:00
parent e90d74e63c
commit e6dd0ec952
2 changed files with 19 additions and 2 deletions

View File

@ -7,12 +7,29 @@ using App = AxibugEmuOnline.Client.ClientCore.App;
namespace AxibugEmuOnline.Client namespace AxibugEmuOnline.Client
{ {
public class Game_NES : MenuItem public class RomListMenuItem : MenuItem
{ {
[SerializeField] [SerializeField]
CanvasGroup RomGroupRoot; CanvasGroup RomGroupRoot;
[SerializeField]
EnumPlatform Platform;
private TweenerCore<float, float, FloatOptions> m_showTween; private TweenerCore<float, float, FloatOptions> m_showTween;
private RomLib RomLib
{
get
{
switch (Platform)
{
case EnumPlatform.NES:
return App.nesRomLib;
default:
throw new System.NotImplementedException($"δʵÏÖµÄƽ̨ {Platform}");
}
}
}
protected override void Awake() protected override void Awake()
{ {
base.Awake(); base.Awake();
@ -54,7 +71,7 @@ namespace AxibugEmuOnline.Client
var thirdMenuGroup = SubMenuItemGroup as ThirdMenuRoot; var thirdMenuGroup = SubMenuItemGroup as ThirdMenuRoot;
thirdMenuGroup.itemGroup.Clear(); thirdMenuGroup.itemGroup.Clear();
App.nesRomLib.FetchRomCount((roms) => RomLib.FetchRomCount((roms) =>
{ {
var thirdMenuGroup = SubMenuItemGroup as ThirdMenuRoot; var thirdMenuGroup = SubMenuItemGroup as ThirdMenuRoot;
thirdMenuGroup.itemGroup.UpdateDependencyProperty(thirdMenuGroup); thirdMenuGroup.itemGroup.UpdateDependencyProperty(thirdMenuGroup);