fix(player): folderId в serialize/load (парность со студией)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
fe7e402ebc
commit
e4125e6488
@ -542,6 +542,7 @@ export class ModelManager {
|
|||||||
opacity: typeof data.opacity === 'number' ? data.opacity : 1,
|
opacity: typeof data.opacity === 'number' ? data.opacity : 1,
|
||||||
tint: data.tint || null,
|
tint: data.tint || null,
|
||||||
name: data.name || null,
|
name: data.name || null,
|
||||||
|
...(data.folderId != null ? { folderId: data.folderId } : {}), // папка
|
||||||
// Параметры геймплея (HP, скорость врага, лимит спавнера и т.п.)
|
// Параметры геймплея (HP, скорость врага, лимит спавнера и т.п.)
|
||||||
gameplayParams: data.gameplayParams || null,
|
gameplayParams: data.gameplayParams || null,
|
||||||
});
|
});
|
||||||
@ -775,6 +776,7 @@ export class ModelManager {
|
|||||||
if (m.tint) data.tint = m.tint;
|
if (m.tint) data.tint = m.tint;
|
||||||
if (m.name) data.name = m.name;
|
if (m.name) data.name = m.name;
|
||||||
if (m.gameplayParams) data.gameplayParams = m.gameplayParams;
|
if (m.gameplayParams) data.gameplayParams = m.gameplayParams;
|
||||||
|
if (m.folderId != null) data.folderId = m.folderId;
|
||||||
if (data.opacity != null || data.tint) this._applyMaterialOverrides(data);
|
if (data.opacity != null || data.tint) this._applyMaterialOverrides(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -865,6 +865,7 @@ export class PrimitiveManager {
|
|||||||
anchored: d.anchored,
|
anchored: d.anchored,
|
||||||
mass: d.mass,
|
mass: d.mass,
|
||||||
name: d.name || null,
|
name: d.name || null,
|
||||||
|
...(d.folderId != null ? { folderId: d.folderId } : {}), // папка (парность со студией)
|
||||||
// locked — защита от выделения/перемещения (Фаза 5.11).
|
// locked — защита от выделения/перемещения (Фаза 5.11).
|
||||||
...(d.locked ? { locked: true } : {}),
|
...(d.locked ? { locked: true } : {}),
|
||||||
// id пользовательской текстуры (картинка из AssetManager).
|
// id пользовательской текстуры (картинка из AssetManager).
|
||||||
|
|||||||
@ -599,6 +599,7 @@ export class UserModelManager {
|
|||||||
// instanceId — чтобы target-скрипты могли стабильно ссылаться
|
// instanceId — чтобы target-скрипты могли стабильно ссылаться
|
||||||
// на конкретный инстанс после перезагрузки.
|
// на конкретный инстанс после перезагрузки.
|
||||||
instanceId: inst.instanceId,
|
instanceId: inst.instanceId,
|
||||||
|
...(inst.folderId != null ? { folderId: inst.folderId } : {}),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return arr;
|
return arr;
|
||||||
@ -663,7 +664,13 @@ export class UserModelManager {
|
|||||||
forceInstanceId: item.instanceId,
|
forceInstanceId: item.instanceId,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
if (id != null) loaded++;
|
if (id != null) {
|
||||||
|
loaded++;
|
||||||
|
if (item.folderId != null) {
|
||||||
|
const inst = this.instances.get(id);
|
||||||
|
if (inst) inst.folderId = item.folderId;
|
||||||
|
}
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.warn('[UserModelManager] failed to load instance', item, e);
|
console.warn('[UserModelManager] failed to load instance', item, e);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user