用户:
传说之下ULB--sans查看:8 回复:10 评论:8 创建时间:2023-01-16T17:08:15
____________________________________________防窥______________________________________
效果图-共36帧

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:'监控中...',
});
}
}
});
名探酱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
评论