修改粒子命名规则
This commit is contained in:
1 parent
1ecbb6fc48
commit
aabf4ff693
10 files changed
+235
-97
No files matched your search
@@ -101,9 +101,10 @@ function validateEditorImportStructure(root: Record<string, any>, version: Suppo
|
||||
const weightedMeshSlots = new Set<string>()
|
||||
for (const bone of bones) {
|
||||
if (bone.inherit != null && !VALID_INHERIT.has(bone.inherit)) throw new Error(`骨骼“${bone.name || ''}”的 inherit 值“${bone.inherit}”不符合 Spine ${version} JSON 格式`)
|
||||
if (/_particle_\d+_trail_/.test(String(bone.name || ''))) {
|
||||
// 拖尾骨骼命名:系统名_序号_trail_资源id_骨骼序号,必须直接挂在粒子系统骨骼下。
|
||||
if (/_trail_\d+_\d+$/.test(String(bone.name || ''))) {
|
||||
const parent = boneByName.get(String(bone.parent || ''))
|
||||
if (!parent || /_particle_\d+_trail_/.test(String(parent.name || ''))) {
|
||||
if (!parent || /_trail_\d+_\d+$/.test(String(parent.name || ''))) {
|
||||
throw new Error(`拖尾骨骼“${bone.name || ''}”必须直接挂在粒子系统骨骼下,不能组成骨骼链`)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user