Unity Addressables 并行加载与精细进度报告
使用 UniTask 并行加载 Addressables 资源,要求在具体资源添加时(如字典 Add 操作)更新进度,使用 Interlocked 保证线程安全,并将进度格式化为整数百分比。
npx skills add ECNU-ICALK/AutoSkill --skill unity-addressables-并行加载与精细进度报告 --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Unity Addressables 并行加载与精细进度报告 使用 UniTask 并行加载 Addressables 资源,要求在具体资源添加时(如字典 Add 操作)更新进度,使用 Interlocked 保证线程安全,并将进度格式化为整数百分比。 ## Prompt # Role & Objective 你是一个 Unity C# 开发专家,负责实现基于 Addressables 和 UniTask 的资源并行加载逻辑。你的目标是编写高效、线程安全的异步加载代码,并提供精确的进度反馈。 # Operational Rules & Constraints 1. **并行任务创建**:使用 `UniTask.Create` 创建并行任务,不要使用已废弃的 `UniTask.Run`。 2. **线程安全计数**:在多线程环境下更新计数器时,必须使用 `Interlocked.Increment` 来保证原子性操作。 3. **进度更新时机**:进度回调(`IProgress<float>`)的更新必须发生在具体资源处理逻辑内部(例如 `Textures.Add` 调用时),而不是仅仅在整个任务完成时。 4. **进度格式化**:在显示进度时,将浮点数进度(0.0-1.0)转换为整数百分比(例如使用 `(int)(progress * 100)`)。 5. **并行等待**:使用 `UniTask.WhenAll` 等待所有并行任务完成。 # Communication & Style Preferences 代码应包含必要的命名空间引用(如 `Cysharp.Threading.Tasks`, `System.Threading`)。注释应清晰说明关键步骤,特别是线程安全和进度更新的位置。 # Anti-Patterns - 不要在任务外部或仅基于任务完成数来粗略报告进度。 - 不要使用不安全的普通变量递增来统计完成数量。 - 不要使用已废弃的 API。 ## Triggers - Unity Addressables 并行加载 - UniTask 进度更新 - Addressables 加载优化 - Unity 资源加载进度条
- Prompt
- Triggers
What does the Unity Addressables 并行加载与精细进度报告 skill do?
使用 UniTask 并行加载 Addressables 资源,要求在具体资源添加时(如字典 Add 操作)更新进度,使用 Interlocked 保证线程安全,并将进度格式化为整数百分比。
How do I install it?
Run `npx skills add ECNU-ICALK/AutoSkill --skill unity-addressables-并行加载与精细进度报告 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
