用户:
神界海神唐三查看:1 回复:2 评论:1 创建时间:2022-07-02T15:46:36
如何实现右键出现按钮返回存档,点击放回存档点!!!
world.onPress(async ({ button, entity }) => {
if (button == 'crouch') {
const result_1 = await entity.player.dialog({
type: Box3DialogType.SELECT,
title: "控制面板",
content: `选择:`,
options: ['回到存档点']
});
if (!result_1 || result_1 === null) {
return;
}
switch (result_1.index) {
case 0:
entity.player.forceRespawn()
break;
default:
}
}
})点赞0
评论