1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-25 22:34:04 +02:00
This commit is contained in:
syuilo
2026-02-16 15:14:37 +09:00
parent aa6c9be133
commit f58de15d45
9 changed files with 71 additions and 51 deletions

View File

@@ -12,15 +12,15 @@ export const cardboardBox = defineObject({
variation: null as string | null,
},
placement: 'top',
createInstance: ({ room, o, root }) => {
createInstance: ({ room, options, root }) => {
return {
onInited: () => {
const boxMesh = root.getChildMeshes().find(m => m.name === 'Box') as BABYLON.Mesh;
if (o.options.variation === 'mikan') {
if (options.variation === 'mikan') {
const tex = new BABYLON.Texture('/client-assets/room/objects/cardboard-box/textures/mikan.png', room.scene, false, false);
(boxMesh.material as BABYLON.PBRMaterial).albedoTexture = tex;
(boxMesh.material as BABYLON.PBRMaterial).albedoColor = new BABYLON.Color3(1, 1, 1);
} else if (o.options.variation === 'aizon') {
} else if (options.variation === 'aizon') {
const tex = new BABYLON.Texture('/client-assets/room/objects/cardboard-box/textures/aizon.png', room.scene, false, false);
(boxMesh.material as BABYLON.PBRMaterial).albedoTexture = tex;
(boxMesh.material as BABYLON.PBRMaterial).albedoColor = new BABYLON.Color3(1, 1, 1);