lists
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
<template>
|
||||
<teleport to=".scene-designer" v-if="active">
|
||||
<teleport to=".scene-designer .game-objects" v-if="active">
|
||||
<g @mousedown="$emit('target', {target:vd, attrs:['x1', 'y1'], delta: true})" :class="{gameObject: true, selected}" v-show="visible && parent.visible">
|
||||
<line :x1="vd.x1" :y1="vd.y1" :x2="parent.vd.x1" :y2="parent.vd.y1"></line>
|
||||
<svg-icon :src="`/asset/thumb/${modelValue.id||0}.webp`" :x="vd.x1" :y="vd.y1" :size="37"></svg-icon>
|
||||
<svg-icon :src="`/asset/thumb/${modelValue.go||0}.webp`" :x="vd.x1" :y="vd.y1" :size="37"></svg-icon>
|
||||
</g>
|
||||
</teleport>
|
||||
<v-card v-if="selected" class="py-4">
|
||||
<asset-selector @select="modelValue.id = $event" type="GameObject">
|
||||
<asset-selector @select="assignGameObject" type="GameObject">
|
||||
<template v-slot:activator="props">
|
||||
<v-btn v-bind="props" prepend-icon="mdi-panorama-outline" color="success" block>Choose game object</v-btn>
|
||||
</template>
|
||||
@@ -47,6 +47,12 @@ export default {
|
||||
methods:{
|
||||
intersect(v){
|
||||
return Utils.intersectLineRect(this.vd, v);
|
||||
},
|
||||
assignGameObject(e){
|
||||
this.modelValue.go = e.id;
|
||||
if (this.modelValue.id == this.modelValue.title){
|
||||
this.modelValue.title = e.name
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user