com.alicizax.unity.framework/Runtime/Scene/SceneComponent.cs
2026-04-20 13:46:44 +08:00

21 lines
459 B
C#

using AlicizaX;
using UnityEngine;
namespace AlicizaX.Scene.Runtime
{
[DisallowMultipleComponent]
[AddComponentMenu("Game Framework/Scene")]
public sealed class SceneComponent : MonoBehaviour
{
private void Awake()
{
if (!AppServices.TryGetApp<ISceneService>(out _))
{
AppServices.RegisterApp(new SceneService());
}
AppServices.EnsureScene();
}
}
}