多轮审查和修复

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,15 +10,37 @@ namespace BaseGames.Core.Events
{
[Multiline] public string description;
public event Action<T> OnEventRaised;
private event Action<T> _onEventRaisedBacking;
#if UNITY_EDITOR
private int _subscriberCount;
#endif
public event Action<T> OnEventRaised
{
add
{
_onEventRaisedBacking += value;
#if UNITY_EDITOR
_subscriberCount++;
#endif
}
remove
{
_onEventRaisedBacking -= value;
#if UNITY_EDITOR
_subscriberCount--;
#endif
}
}
public void Raise(T value)
{
#if UNITY_EDITOR
EventBusMonitor.Record(name, value?.ToString() ?? "null",
OnEventRaised?.GetInvocationList().Length ?? 0);
_subscriberCount,
Time.frameCount);
#endif
OnEventRaised?.Invoke(value);
_onEventRaisedBacking?.Invoke(value);
}
/// <summary>
@@ -38,15 +60,37 @@ namespace BaseGames.Core.Events
{
[Multiline] public string description;
public event Action OnEventRaised;
private event Action _onEventRaisedBacking;
#if UNITY_EDITOR
private int _subscriberCount;
#endif
public event Action OnEventRaised
{
add
{
_onEventRaisedBacking += value;
#if UNITY_EDITOR
_subscriberCount++;
#endif
}
remove
{
_onEventRaisedBacking -= value;
#if UNITY_EDITOR
_subscriberCount--;
#endif
}
}
public void Raise()
{
#if UNITY_EDITOR
EventBusMonitor.Record(name, "<void>",
OnEventRaised?.GetInvocationList().Length ?? 0);
_subscriberCount,
Time.frameCount);
#endif
OnEventRaised?.Invoke();
_onEventRaisedBacking?.Invoke();
}
/// <summary>