auto-git:

[change] src/assets/delete-project-asset.ts
This commit is contained in:
2026-04-22 12:33:17 +02:00
parent b11afbe969
commit 7430e95608

View File

@@ -86,6 +86,35 @@ function cleanupSceneForDeletedAsset(
};
}
if (asset.kind === "image") {
const nextTimeOfDay = { ...nextWorld.timeOfDay };
let didChangeTimeOfDay = false;
for (const phase of ["dawn", "dusk"] as const) {
const profile = nextTimeOfDay[phase];
if (
profile.background.mode === "image" &&
profile.background.assetId === asset.id
) {
nextTimeOfDay[phase] = {
...profile,
background: {
...profile.background,
assetId: ""
}
};
didChangeTimeOfDay = true;
}
}
if (didChangeTimeOfDay) {
nextWorld = {
...nextWorld,
timeOfDay: nextTimeOfDay
};
}
}
if (asset.kind === "model") {
const remainingModelInstances: ProjectScene["modelInstances"] = {};
const updatedEntities: ProjectScene["entities"] = {};