猫史档案馆


【教程帖】选项式摄像头监控代码

用户:传说之下ULB--sans传说之下ULB--sans查看:8 回复:10 评论:8 创建时间:2023-01-16T17:08:15


____________________________________________防窥______________________________________

效果图-共36帧

center_image

const FK = world.querySelector('#单元方块-1');
const zhiyin = world.querySelector('#白羽鸡-1');

const jk = world.querySelector('#Windows95-1');//找到模型
//交互设置
jk.enableInteract = true;
jk.interactHint = '选项式监控';
jk.interactRadius = 3;

jk.onInteract(async({ entity }) => {
    const d = await entity.player.dialog({
        type: Box3DialogType.SELECT,//SELECT选择样式对话框
        title: '电脑',
        titleTextColor: new Box3RGBAColor(0, 0, 0, 1),
        titleBackgroundColor: new Box3RGBAColor(0.968, 0.702, 0.392, 1),
        options: ['1号', '2号'],   // 将提供玩家选择的选项放入数组里。
        content: '你要监控几号?',
    })
    if (d) {//如果选择
        const { index } = d;//解构赋值
        if (index === 0) {//第一项
               entity.player.dialog({
             type: Box3DialogType.TEXT,
             title: '监控',
             lookEye: world.querySelector('#监控摄像头-1'),             // 将相机放在玩家位置
             lookTarget: FK,             //npc可以改
             content:'监控中...',
            });  
        }
    }
    if (d) {//如果选择
        const { index } = d;//解构赋值
        if (index === 1) {//第一项
               entity.player.dialog({
             type: Box3DialogType.TEXT,
             title: '监控',
             lookEye: world.querySelector('#sans-1'),             // 将相机放在玩家位置
             lookTarget: zhiyin,             //npc可以改
             content:'监控中...',
            });  
        }
    }
});

文本样式对话框https://shequ.codemao.cn/community/499487


回复

上一页1 页 / 共 1下一页
爱学习的天狗爱学习的天狗

emotion_编程猫_点赞

点赞0


评论


爱学习的天狗爱学习的天狗

好用

 

点赞0


评论


yee剑走天下yee剑走天下

《zhiyin》看来是小黑子啊,我这个大黑子很荣幸碰到了你emotion_doge

点赞0


评论


一吱笑喵一吱笑喵

捉!!!

点赞0


评论


火菊火菊

暗藏玄只因((

点赞0


评论


名探酱名探酱

if (d) {//如果选择
        if (d.index === 0) {//第一项
               entity.player.dialog({
             type: Box3DialogType.TEXT,
             title: '监控',
             lookEye: world.querySelector('#监控摄像头-1'),             // 将相机放在玩家位置
             lookTarget: FK,             //npc可以改
             content:'监控中...',
            });  
        }
        if (d.index === 1) {
        }
    }
    

简化了一下

点赞1


评论


宽容的彗星猫ybDX宽容的彗星猫ybDX

e,我会摄像头能转动的那种

点赞0


评论


raearaea

收藏

点赞0


评论


屑怪盗屑怪盗

喵d

 

点赞0


评论


yyds二营长yyds二营长

收藏

点赞1


评论