mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-23 03:04:29 +08:00
- 从 Architecture.cs 中移除所有 EventBus.Send 事件发送调用 - 删除 ArchitectureEvents.cs 文件及其相关事件定义 - 移除架构销毁开始、销毁完成和初始化失败事件的发送逻辑 - 更新测试代码移除对已删除事件的依赖
23 lines
643 B
C#
23 lines
643 B
C#
using System;
|
|
using GFramework.Core.Abstractions.events;
|
|
|
|
namespace GFramework.Core.events;
|
|
|
|
/// <summary>
|
|
/// 默认注销器类,用于执行注销操作
|
|
/// </summary>
|
|
/// <param name="onUnRegister">注销时要执行的回调函数</param>
|
|
public class DefaultUnRegister(Action onUnRegister) : IUnRegister
|
|
{
|
|
private Action? _mOnUnRegister = onUnRegister;
|
|
|
|
/// <summary>
|
|
/// 执行注销操作,调用注册的回调函数并清理引用
|
|
/// </summary>
|
|
public void UnRegister()
|
|
{
|
|
// 调用注销回调函数并清理引用
|
|
_mOnUnRegister?.Invoke();
|
|
_mOnUnRegister = null;
|
|
}
|
|
} |