refactor(particle): rename ParticleScaleMode enums for clarity#2970
refactor(particle): rename ParticleScaleMode enums for clarity#2970cptbtptpbcptdtptp merged 4 commits intodev/2.0from
Conversation
Rename `Hierarchy` to `World` and `World` to `Shape` to better align with user intuition — `World` matches the existing `worldScale` concept, and `Shape` accurately describes that only the emission shape is scaled.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThe particle scaling modes were reworked: Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev/2.0 #2970 +/- ##
===========================================
- Coverage 77.51% 77.25% -0.26%
===========================================
Files 900 901 +1
Lines 98724 98937 +213
Branches 9785 9852 +67
===========================================
- Hits 76521 76430 -91
- Misses 22037 22338 +301
- Partials 166 169 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/core/src/particle/enums/ParticleScaleMode.ts`:
- Around line 4-10: References to the removed enum member
ParticleScaleMode.Hierarchy remain in three assignments; replace each usage of
ParticleScaleMode.Hierarchy with an existing mode (e.g.,
ParticleScaleMode.World) so the code compiles — update the three assignments
that set ParticleScaleMode.Hierarchy to instead set ParticleScaleMode.World (or
another appropriate remaining member: Local or Shape) ensuring all occurrences
of ParticleScaleMode.Hierarchy are removed.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: ab430c82-354f-48e9-af44-37efd61fc80e
📒 Files selected for processing (2)
packages/core/src/particle/enums/ParticleScaleMode.tspackages/core/src/particle/modules/MainModule.ts
|
仓库内还有旧调用:e2e/case/particleRenderer-fire.ts |
|
文档的 scalingMode 也还是旧语义 |
|
已修复:
@hhhhkrx 感谢指出 🙏 |
GuoLei1990
left a comment
There was a problem hiding this comment.
已关闭问题清单
| 问题 | 关闭原因 |
|---|---|
| [P0] e2e/case/particleRenderer-fire.ts Hierarchy 引用未更新 | 已修复 (commit 16c3a5f) |
| [P2] MainModule.ts fall-through 缺注释 | 建议性,不阻塞 |
| hhhhkrx: 文档 scalingMode 旧语义 | 已修复 (commit 6d8f290) |
| hhhhkrx: 仓库内还有旧调用 e2e | 已修复 (commit 16c3a5f) |
总结
增量审查:上轮 P0(e2e 旧引用)和 hhhhkrx 指出的文档旧语义均已修复。grep 确认仓库内无残留 ParticleScaleMode.Hierarchy 引用。代码干净,无新问题。可合入。
问题
无新问题。
简化建议
无。
GuoLei1990
left a comment
There was a problem hiding this comment.
总结
纯重命名 PR:ParticleScaleMode.Hierarchy → World,ParticleScaleMode.World → Shape。命名改进合理——World 与引擎的 worldScale 概念对齐,Shape 与 Unity ParticleSystemScalingMode.Shape 一致且语义更准确。枚举序号不变,无序列化兼容问题。上轮 P0(e2e 旧引用)和 hhhhkrx 指出的文档旧语义均已修复。grep 确认仓库内无残留 ParticleScaleMode.Hierarchy 引用。
问题
无新问题。
简化建议
无。代码干净,可合入。
Summary
ParticleScaleMode.Hierarchy→Worldto align with the existingworldScaleconcept users are already familiar withParticleScaleMode.World→Shapeto accurately describe that only the emission shape is scaled (consistent with Unity'sParticleSystemScalingMode.Shape)Note
Enum ordinal values are unchanged (
World=0, Local=1, Shape=2), no serialization impact.Test plan
Summary by CodeRabbit