用户:
神界海神唐三查看:0 回复:2 评论:0 创建时间:2022-07-20T12:41:52
模型电脑交互后电脑询问要监视谁,随后给出在线玩家名称,点哪个,视角就跟随哪个玩家的视角!
悄悄告诉你有超级大奖!
console.clear();
const e = world.querySelector('#电脑-1');
e.enableInteract = true;
e.onInteract(async ({ entity }) => {
if (entity.isPlayer) {
let s = [];
let z = [];
world.querySelectorAll('player').forEach((x) => {
s.push(x.player.name);
z.push(x);
})
const npc = await entity.player.dialog({
type: Box3DialogType.SELECT,
content: '你要观战谁?',
options: s,
})
if (npc) {
entity.player.cameraEntity = z[npc.index];
}
}
})
world.onPlayerJoin(({entity})=>{
entity.player.cameraMode=Box3CameraMode.FOLLOW;
})点赞0
评论