Add readSceneTransitionTargetKey function in App.tsx

This commit is contained in:
2026-04-15 03:43:57 +02:00
parent 7ea183d677
commit 675c15fabf

View File

@@ -1375,6 +1375,33 @@ function readSequenceVisibilityTargetKey(
throw new Error("Sequence visibility targets must reference a brush or model instance.");
}
function readSceneTransitionTargetKey(value: string): {
targetSceneId: string;
targetEntryEntityId: string;
} {
const separatorIndex = value.indexOf("::");
if (separatorIndex <= 0 || separatorIndex >= value.length - 2) {
throw new Error(
"Scene transition targets must reference a scene id and Scene Entry id."
);
}
const targetSceneId = value.slice(0, separatorIndex).trim();
const targetEntryEntityId = value.slice(separatorIndex + 2).trim();
if (targetSceneId.length === 0 || targetEntryEntityId.length === 0) {
throw new Error(
"Scene transition targets must reference a scene id and Scene Entry id."
);
}
return {
targetSceneId,
targetEntryEntityId
};
}
function getDefaultTriggerVolumeLinkTrigger(
triggerOnEnter: boolean,
triggerOnExit: boolean