mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-06-26 11:24:46 +00:00
44 lines
929 B
C#
44 lines
929 B
C#
|
using System;
|
|||
|
using Cysharp.Threading.Tasks;
|
|||
|
using JNGame.Util;
|
|||
|
using Plugins.JNGame.System;
|
|||
|
|
|||
|
namespace JNGame
|
|||
|
{
|
|||
|
public class JNetGame : SingletonScene<JNetGame>
|
|||
|
{
|
|||
|
private SystemBase[] _systems;
|
|||
|
public async UniTask Init(SystemBase[] systems)
|
|||
|
{
|
|||
|
_systems = systems;
|
|||
|
foreach (var system in _systems)
|
|||
|
{
|
|||
|
if (system is not null)
|
|||
|
{
|
|||
|
await system.OnInit();
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public void Close()
|
|||
|
{
|
|||
|
if (_systems is not null)
|
|||
|
{
|
|||
|
foreach (var system in _systems)
|
|||
|
{
|
|||
|
system?.OnClose();
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
private void OnApplicationQuit()
|
|||
|
{
|
|||
|
Close();
|
|||
|
}
|
|||
|
|
|||
|
protected override void OnDispose()
|
|||
|
{
|
|||
|
Close();
|
|||
|
}
|
|||
|
}
|
|||
|
}
|