1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-13 16:25:44 +02:00
This commit is contained in:
syuilo
2026-02-26 15:48:59 +09:00
parent 4d37ada54d
commit d8dc66781f
3 changed files with 22 additions and 3 deletions

View File

@@ -10,11 +10,27 @@ export const wallClock = defineObject({
id: 'wallClock',
name: 'Wall Clock',
options: {
schema: {},
default: {},
schema: {
frameColor: {
type: 'color',
label: 'Frame color',
},
},
default: {
frameColor: [0.71, 0.58, 0.39],
},
},
placement: 'side',
createInstance: ({ room, root }) => {
createInstance: ({ room, root, options, findMaterial }) => {
const frameMaterial = findMaterial('__X_FRAME__');
const applyFrameColor = () => {
const [r, g, b] = options.frameColor;
frameMaterial.albedoColor = new BABYLON.Color3(r, g, b);
};
applyFrameColor();
return {
onInited: () => {
const hourHand = root.getChildMeshes().find(m => m.name === 'HandH') as BABYLON.Mesh;
@@ -29,6 +45,9 @@ export const wallClock = defineObject({
minuteHand.rotation = new BABYLON.Vector3(0, 0, mAngle);
}, 1000));
},
onOptionsUpdated: ([k, v]) => {
applyFrameColor();
},
interactions: {},
};
},