AlicizaX/Client/Assets/Books/Framework/Plugins/Plugins.md
2026-04-01 13:20:06 +08:00

55 lines
1.4 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Plugins
## 模块概述
`Plugins` 目录保存框架依赖的第三方程序集与源码生成插件,它们补充了框架运行时能力、兼容层与自动注册逻辑。
## 快速开始
通常不需要业务层主动初始化本模块。开发者需要做的是:
1. 确认 Unity 正常导入 DLL
2. 不随意删除或移动 `Plugins` 目录文件
3. 在 UI / Event 自动注册异常时优先检查生成器 DLL 是否生效
## 架构说明
```text
Plugins
├─ XLog.dll
├─ SharpZipLib
├─ System.Memory / Buffers / Unsafe
├─ EventSourceGenerator.dll
└─ UISourceGenerator.dll
```
## 主要内容
- `XLog.dll`:日志能力支持
- `ICSharpCode.SharpZipLib.dll`:压缩/解压相关能力
- `System.Buffers.dll`、`System.Memory.dll`、`System.Runtime.CompilerServices.Unsafe.dll`:底层兼容依赖
- `EventSourceGenerator.dll`:事件源码生成插件
- `UISourceGenerator.dll`UI 源码生成插件
## API / 作用说明
### `EventSourceGenerator.dll`
- 作用:辅助事件相关代码生成
### `UISourceGenerator.dll`
- 作用:辅助 UI 元数据与资源绑定注册
## 完整使用示例
```csharp
// 本模块通常不直接由业务代码调用。
// 若出现 UI/Event 自动注册异常,请先检查对应 DLL 在 Unity 中是否正常导入。
```
## 最佳实践
- 锁定插件版本
- 升级 Unity 后优先验证生成器与 IL2CPP 打包链路