多轮审查和修复

This commit is contained in:
2026-05-12 15:34:08 +08:00
parent f55d2a57c3
commit ebbbb7332e
805 changed files with 838724 additions and 1905 deletions

View File

@@ -10,19 +10,16 @@ namespace BaseGames.Core.Events
/// </summary>
public class EventChannelRegistry : MonoBehaviour, IEventChannelRegistry
{
public static EventChannelRegistry Instance { get; private set; }
private readonly Dictionary<string, ScriptableObject> _channels = new();
private void Awake()
{
if (Instance != null && Instance != this)
if (BaseGames.Core.ServiceLocator.GetOrDefault<IEventChannelRegistry>() != null)
{
Destroy(gameObject);
return;
}
Instance = this;
DontDestroyOnLoad(gameObject);
BaseGames.Core.ServiceLocator.Register<IEventChannelRegistry>(this);
}
/// <summary>由 EventChannelRegistrar 在场景初始化时批量注册频道 SO。</summary>