<template>
    <div>
        <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>
        </asset-selector>
        <v-textarea :label="l.description" v-model="modelValue.description" class="mt-3"></v-textarea>
        <v-checkbox density="compact" v-model="modelValue.hud" hide-details label="Observe in head-up display"></v-checkbox>
        <v-checkbox density="compact" v-model="modelValue.exclude" hide-details label="Disable interactions"></v-checkbox>
        <v-checkbox density="compact" v-model="modelValue.noPhysics" hide-details label="Disable collisions"></v-checkbox>
        <v-img :src="`/asset/thumb/${modelValue.go}.webp`" />
        <div class="text-caption text-center">{{ modelValue.title }}</div>
    </div>
</template>

<script>

export default {
    data(){
        return {
            active: false
        }
    },
    mounted(){
        this.active = true;
    },
    props:{
        modelValue: Object
    },
    methods:{
        assignGameObject(e){
            this.modelValue.go = e.id;
            if (this.modelValue.id == this.modelValue.title){
                this.modelValue.title = e.name
            }
            // if (e.type == 'InteractiveObject'){
            //     this.modelValue.type = e.id;
            // }else{
            //     this.modelValue.type = 'GenericObject'
            // }
        }
    }
}

</script>