用户:
银狐残影查看:0 回复:3 评论:0 创建时间:2022-01-06T21:05:38
imgsrc="https://static.codemao.cn/emoji/codemao/%E7%BC%96%E7%A8%8B%E7%8C%AB_%E4%BC%A4%E5%BF%83.gif"alt="emotion_编程猫_伤心"
银狐残影/**
* godzilla
*/
world.querySelectorAll('#哥斯拉头套-1').forEach((e) => e.destroy());
world.querySelectorAll('#哥斯拉装甲-1').forEach((e) => e.destroy());
world.querySelectorAll('#哥斯拉尾巴-1').forEach((e) => e.destroy());
world.querySelectorAll('#哥斯拉左小腿-1').forEach((e) => e.destroy());
world.querySelectorAll('#哥斯拉左小腿-2').forEach((e) => e.destroy());
world.querySelectorAll('#哥斯拉左小腿-3').forEach((e) => e.destroy());
world.querySelectorAll('#哥斯拉左小腿-4').forEach((e) => e.destroy());
world.querySelectorAll('#哥斯拉左小腿-5').forEach((e) => e.destroy());
world.querySelectorAll('#哥斯拉左小腿-6').forEach((e) => e.destroy());
world.querySelectorAll('#哥斯拉左小腿-7').forEach((e) => e.destroy());
world.querySelectorAll('#哥斯拉左小腿-8').forEach((e) => e.destroy());
const WEAPON = {
1: { // 头部
mesh: world.querySelector('#哥斯拉头套-1').mesh,
parts: [Box3BodyPart.HEAD],
scale: new Box3Vector3(0.52, 0.41, 0.52), // 调整大小
orientation: new Box3Quaternion(0, 1, 0, -1).rotateX(0).rotateY(0),
offset: new Box3Vector3(0, 0.58, 0), //调整位置
},
2: { // 身体
mesh: world.querySelector('#哥斯拉装甲-1').mesh,
parts: [Box3BodyPart.TORSO],
scale: new Box3Vector3(0.36, 0.37, 0.34), // 调整大小
orientation: new Box3Quaternion(0, 1, 0, 0).rotateX(0).rotateY(0),
offset: new Box3Vector3(0, 0.22, -0.15), //调整位置
},
3: { // 尾巴
mesh: world.querySelector('#哥斯拉尾巴-1').mesh,
parts: [Box3BodyPart.HIPS],
scale: new Box3Vector3(0.25, 0.25, 0.25), // 调整大小
orientation: new Box3Quaternion(0, 1, 0, 0).rotateX(0).rotateY(0),
offset: new Box3Vector3(0, 0.1, -0.73), //调整位置
},
4: { // 左上臂
mesh: world.querySelector('#哥斯拉左小腿-1').mesh,
parts: [Box3BodyPart.LEFT_UPPER_ARM],
scale: new Box3Vector3(0.52, 0.31, 0.52), // 调整大小
orientation: new Box3Quaternion(0, 1, 0, 0).rotateX(0).rotateY(0).rotateZ(0),
offset: new Box3Vector3(0, 0, 0), //调整位置
},
5: { // 左下臂
mesh: world.querySelector('#哥斯拉左小腿-2').mesh,
parts: [Box3BodyPart.LEFT_LOWER_ARM],
scale: new Box3Vector3(0.52, 0.31, 0.52), // 调整大小
orientation: new Box3Quaternion(0, 1, 0, 0),
offset: new Box3Vector3(0, 0, 0), //调整位置
},
6: { // 右上臂
mesh: world.querySelector('#哥斯拉左小腿-3').mesh,
parts: [Box3BodyPart.RIGHT_UPPER_ARM],
scale: new Box3Vector3(0.52, 0.31, 0.52), // 调整大小
orientation: new Box3Quaternion(0, 1, 0, 0),
offset: new Box3Vector3(0, 0, 0), //调整位置
},
7: { // 右下臂
mesh: world.querySelector('#哥斯拉左小腿-4').mesh,
parts: [Box3BodyPart.RIGHT_LOWER_ARM],
scale: new Box3Vector3(0.52, 0.31, 0.52), // 调整大小
orientation: new Box3Quaternion(0, 1, 0, 0),
offset: new Box3Vector3(0, 0, 0), //调整位置
},
8: { // 左大腿
mesh: world.querySelector('#哥斯拉左小腿-5').mesh,
parts: [Box3BodyPart.LEFT_UPPER_LEG],
scale: new Box3Vector3(0.52, 0.53, 0.52), // 调整大小
orientation: new Box3Quaternion(0, 1, 0, 0),
offset: new Box3Vector3(0, 0, 0), //调整位置
},
9: { // 左小腿
mesh: world.querySelector('#哥斯拉左小腿-6').mesh,
parts: [Box3BodyPart.LEFT_LOWER_LEG],
scale: new Box3Vector3(0.52, 0.53, 0.52), // 调整大小
orientation: new Box3Quaternion(0, 1, 0, 0),
offset: new Box3Vector3(0, 0, 0), //调整位置
},
10: { // 右大腿
mesh: world.querySelector('#哥斯拉左小腿-7').mesh,
parts: [Box3BodyPart.RIGHT_UPPER_LEG],
scale: new Box3Vector3(0.52, 0.53, 0.52), // 调整大小
orientation: new Box3Quaternion(0, 1, 0, 0),
offset: new Box3Vector3(0, 0, 0), //调整位置
},
11: { // 右小腿
mesh: world.querySelector('#哥斯拉左小腿-8').mesh,
parts: [Box3BodyPart.RIGHT_LOWER_LEG],
scale: new Box3Vector3(0.52, 0.53, 0.52), // 调整大小
orientation: new Box3Quaternion(0, 1, 0, 0),
offset: new Box3Vector3(0, 0, 0), //调整位置
},
};
function godzillaWeapon(entity, camp) {
WEAPON[camp].parts.forEach((part) => entity.player.addWearable({
bodyPart: part, // 装备
mesh: WEAPON[camp].mesh, // 设置武器mesh
orientation: WEAPON[camp].orientation, // 设置方向
scale: WEAPON[camp].scale, // 设置大小
offset: WEAPON[camp].offset, // 设置位置
}));
}
function trueGodzillaWeapon(entity){
godzillaWeapon(entity, '1')
godzillaWeapon(entity, '2')
godzillaWeapon(entity, '3')
godzillaWeapon(entity, '4')
godzillaWeapon(entity, '5')
godzillaWeapon(entity, '6')
godzillaWeapon(entity, '7')
godzillaWeapon(entity, '8')
godzillaWeapon(entity, '9')
godzillaWeapon(entity, '10')
godzillaWeapon(entity, '11')
}
world.onPlayerJoin(({ entity }) => {
entity.player.skinInvisible.head=true;
entity.player.skinInvisible.hips=true;
entity.player.skinInvisible.leftFoot=false;
entity.player.skinInvisible.leftHand=false;
entity.player.skinInvisible.leftLowerArm=true;
entity.player.skinInvisible.leftLowerLeg=true;
entity.player.skinInvisible.leftShoulder=true;
entity.player.skinInvisible.leftUpperArm=true;
entity.player.skinInvisible.leftUpperLeg=true;
entity.player.skinInvisible.neck=true;
entity.player.skinInvisible.rightFoot=false;
entity.player.skinInvisible.rightHand=false;
entity.player.skinInvisible.rightLowerArm=true;
entity.player.skinInvisible.rightLowerLeg=true;
entity.player.skinInvisible.rightShoulder=true;
entity.player.skinInvisible.rightUpperArm=true;
entity.player.skinInvisible.rightUpperLeg=true;
entity.player.skinInvisible.torso=true;
trueGodzillaWeapon(entity)
})点赞1
评论