com.alicizax.unity.framework/Runtime/Scene/SceneComponent.cs

21 lines
459 B
C#
Raw Normal View History

2025-09-05 19:46:30 +08:00
using AlicizaX;
using UnityEngine;
namespace AlicizaX.Scene.Runtime
{
[DisallowMultipleComponent]
[AddComponentMenu("Game Framework/Scene")]
public sealed class SceneComponent : MonoBehaviour
{
private void Awake()
{
2026-04-20 13:46:44 +08:00
if (!AppServices.TryGetApp<ISceneService>(out _))
{
2026-04-20 13:46:44 +08:00
AppServices.RegisterApp(new SceneService());
}
AppServices.EnsureScene();
2025-09-05 19:46:30 +08:00
}
}
}