Update defaultTarget selection logic in App.tsx
This commit is contained in:
@@ -1657,14 +1657,7 @@ export function App({ store, initialStatusMessage }: AppProps) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const defaultTarget = soundEmitterOptions.find(({ entity }) => {
|
const defaultTarget = playableSoundEmitterOptions[0]?.entity;
|
||||||
if (entity.audioAssetId === null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
const asset = editorState.document.assets[entity.audioAssetId];
|
|
||||||
return asset?.kind === "audio";
|
|
||||||
})?.entity;
|
|
||||||
|
|
||||||
if (defaultTarget === undefined) {
|
if (defaultTarget === undefined) {
|
||||||
setStatusMessage("Author a Sound Emitter with an audio asset before adding sound links.");
|
setStatusMessage("Author a Sound Emitter with an audio asset before adding sound links.");
|
||||||
|
|||||||
Reference in New Issue
Block a user