2026-03-26 16:14:05 +08:00
|
|
|
using AlicizaX;
|
|
|
|
|
using AlicizaX.Audio.Runtime;
|
|
|
|
|
using AlicizaX.Localization.Runtime;
|
|
|
|
|
using AlicizaX.ObjectPool;
|
|
|
|
|
using AlicizaX.Resource.Runtime;
|
|
|
|
|
using AlicizaX.Scene.Runtime;
|
|
|
|
|
using AlicizaX.UI.Runtime;
|
|
|
|
|
|
|
|
|
|
public static partial class GameApp
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取游戏基础组件。
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static RootModule Base => RootModule.Instance;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取声音组件。
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static IAudioService Audio
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
if (_audio == null)
|
|
|
|
|
{
|
2026-04-20 13:46:44 +08:00
|
|
|
_audio = AppServices.RequireApp<IAudioService>();
|
2026-03-26 16:14:05 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return _audio;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static IAudioService _audio;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取本地化组件。
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static ILocalizationService Localization
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
if (_localization == null)
|
|
|
|
|
{
|
2026-04-20 13:46:44 +08:00
|
|
|
_localization = AppServices.RequireApp<ILocalizationService>();
|
2026-03-26 16:14:05 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return _localization;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static ILocalizationService _localization;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取对象池组件。
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static IObjectPoolService ObjectPool
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
if (_objectPool == null)
|
|
|
|
|
{
|
2026-04-20 13:46:44 +08:00
|
|
|
_objectPool = AppServices.RequireApp<IObjectPoolService>();
|
2026-03-26 16:14:05 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return _objectPool;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static IObjectPoolService _objectPool;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取有限状态机组件。
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static IProcedureService Procedure
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
if (_procedure == null)
|
|
|
|
|
{
|
2026-04-20 13:46:44 +08:00
|
|
|
_procedure = AppServices.RequireApp<IProcedureService>();
|
2026-03-26 16:14:05 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return _procedure;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static IProcedureService _procedure;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取Asset组件。
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static IResourceService Resource
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
if (_resource == null)
|
|
|
|
|
{
|
2026-04-20 13:46:44 +08:00
|
|
|
_resource = AppServices.RequireApp<IResourceService>();
|
2026-03-26 16:14:05 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return _resource;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static IResourceService _resource;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取场景组件。
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static ISceneService Scene
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
if (_scene == null)
|
|
|
|
|
{
|
2026-04-20 13:46:44 +08:00
|
|
|
_scene = AppServices.RequireApp<ISceneService>();
|
2026-03-26 16:14:05 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return _scene;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static ISceneService _scene;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取定时器组件。
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static ITimerService Timer
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
if (_timer == null)
|
|
|
|
|
{
|
2026-04-20 13:46:44 +08:00
|
|
|
_timer = AppServices.RequireApp<ITimerService>();
|
2026-03-26 16:14:05 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return _timer;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static ITimerService _timer;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取UI组件。
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static IUIService UI
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
if (_ui == null)
|
|
|
|
|
{
|
2026-04-20 13:46:44 +08:00
|
|
|
_ui = AppServices.RequireApp<IUIService>();
|
2026-03-26 16:14:05 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return _ui;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static IUIService _ui;
|
|
|
|
|
}
|