feat: engine utils, editor and asset prefix improvements

This commit is contained in:
2026-06-14 17:39:07 +08:00
parent e0331ab5a7
commit 271c909398
3 changed files with 9 additions and 8 deletions

View File

@@ -1,6 +1,7 @@
<script setup lang="ts">
import { ref, computed, onMounted } from 'vue'
import type { GameData, SceneNode } from '@engine/types'
import { resolveAsset } from '@engine/utils'
import { useGraphEditor } from './composables/useGraphEditor'
import SceneGraph from './components/SceneGraph.vue'
import NodeEditor from './components/NodeEditor.vue'
@@ -21,7 +22,7 @@ const selectedScene = computed<SceneNode | null>(() => {
const previewVideoUrl = computed(() => {
const url = selectedScene.value?.videoUrl
if (!url) return null
return url.startsWith('/') ? url : '/' + url
return resolveAsset(editor.gameData.value.assetBase || '', url)
})
function newNode() {