AxibugEmuOnline/AxibugEmuOnline.Client/Assets/Script/NesCoreProxy.cs

36 lines
781 B
C#
Raw Normal View History

2024-07-04 10:41:48 +08:00
using AxibugEmuOnline.Client.Manager;
2024-07-04 21:06:41 +08:00
using MyNes.Core;
using System.IO;
2024-07-04 10:41:48 +08:00
using UnityEngine;
2024-07-04 21:06:41 +08:00
using UnityEngine.UI;
2024-07-04 10:41:48 +08:00
namespace AxibugEmuOnline.Client
{
public class NesCoreProxy : MonoBehaviour
{
2024-07-04 21:06:41 +08:00
public static NesCoreProxy Instance { get; private set; }
public UguiVideoProvider VideoCom;
public AudioProvider AudioCom;
2024-07-04 21:06:41 +08:00
2024-07-04 10:41:48 +08:00
private AppEmu m_appEnum = new AppEmu();
private void Start()
{
2024-07-04 21:06:41 +08:00
Instance = this;
m_appEnum.Init(VideoCom, AudioCom);
2024-07-04 21:06:41 +08:00
}
2024-07-16 16:30:20 +08:00
private void Update()
{
m_appEnum.ExecuteFrameLogic();
}
2024-07-04 21:06:41 +08:00
private void OnDestroy()
{
Instance = null;
m_appEnum.Dispose();
}
2024-07-04 10:41:48 +08:00
}
}