1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-28 14:44:44 +02:00
This commit is contained in:
syuilo
2026-04-08 12:49:32 +09:00
parent 5736b43149
commit 58acbac7ef
3 changed files with 15 additions and 0 deletions

View File

@@ -12,6 +12,10 @@ export const tv = defineObject({
name: 'TV', name: 'TV',
options: { options: {
schema: { schema: {
bodyColor: {
type: 'color',
label: 'Body color',
},
screenBrightness: { screenBrightness: {
type: 'range', type: 'range',
label: 'Screen brightness', label: 'Screen brightness',
@@ -21,6 +25,7 @@ export const tv = defineObject({
}, },
}, },
default: { default: {
bodyColor: [0, 0, 0],
screenBrightness: 0.5, screenBrightness: 0.5,
}, },
}, },
@@ -51,9 +56,19 @@ export const tv = defineObject({
applyScreenBrightness(); applyScreenBrightness();
const bodyMaterial = model.findMaterial('__X_BODY__');
const applyBodyColor = () => {
const [r, g, b] = options.bodyColor;
bodyMaterial.albedoColor = new BABYLON.Color3(r, g, b);
};
applyBodyColor();
return { return {
onOptionsUpdated: ([k, v]) => { onOptionsUpdated: ([k, v]) => {
switch (k) { switch (k) {
case 'bodyColor': applyBodyColor(); break;
case 'screenBrightness': applyScreenBrightness(); break; case 'screenBrightness': applyScreenBrightness(); break;
} }
}, },