mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-13 16:25:44 +02:00
wip
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -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: {},
|
||||
};
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user