mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-06-25 17:10:43 +00:00
Update ironWoodShelf.ts
This commit is contained in:
parent
ebc9a60237
commit
abe22da9ed
1 changed files with 28 additions and 0 deletions
|
|
@ -16,14 +16,20 @@ export const ironWoodShelfH = defineObject({
|
|||
type: 'color',
|
||||
label: 'Frame color',
|
||||
},
|
||||
boardColor: {
|
||||
type: 'color',
|
||||
label: 'Board color',
|
||||
},
|
||||
},
|
||||
default: {
|
||||
frameColor: [0.2, 0.2, 0.2],
|
||||
boardColor: [0.8, 0.4, 0.1],
|
||||
},
|
||||
},
|
||||
placement: 'floor',
|
||||
createInstance: ({ options, model }) => {
|
||||
const frameMaterial = model.findMaterial('__X_FRAME__');
|
||||
const boardMaterial = model.findMaterial('__X_BOARD__');
|
||||
|
||||
const applyFrameColor = () => {
|
||||
const [r, g, b] = options.frameColor;
|
||||
|
|
@ -32,9 +38,17 @@ export const ironWoodShelfH = defineObject({
|
|||
|
||||
applyFrameColor();
|
||||
|
||||
const applyBoardColor = () => {
|
||||
const [r, g, b] = options.boardColor;
|
||||
boardMaterial.albedoColor = new BABYLON.Color3(r, g, b);
|
||||
};
|
||||
|
||||
applyBoardColor();
|
||||
|
||||
return {
|
||||
onOptionsUpdated: ([k, v]) => {
|
||||
applyFrameColor();
|
||||
applyBoardColor();
|
||||
},
|
||||
interactions: {},
|
||||
};
|
||||
|
|
@ -51,14 +65,20 @@ export const ironWoodShelfV = defineObject({
|
|||
type: 'color',
|
||||
label: 'Frame color',
|
||||
},
|
||||
boardColor: {
|
||||
type: 'color',
|
||||
label: 'Board color',
|
||||
},
|
||||
},
|
||||
default: {
|
||||
frameColor: [0.2, 0.2, 0.2],
|
||||
boardColor: [0.8, 0.4, 0.1],
|
||||
},
|
||||
},
|
||||
placement: 'floor',
|
||||
createInstance: ({ options, model }) => {
|
||||
const frameMaterial = model.findMaterial('__X_FRAME__');
|
||||
const boardMaterial = model.findMaterial('__X_BOARD__');
|
||||
|
||||
const applyFrameColor = () => {
|
||||
const [r, g, b] = options.frameColor;
|
||||
|
|
@ -67,9 +87,17 @@ export const ironWoodShelfV = defineObject({
|
|||
|
||||
applyFrameColor();
|
||||
|
||||
const applyBoardColor = () => {
|
||||
const [r, g, b] = options.boardColor;
|
||||
boardMaterial.albedoColor = new BABYLON.Color3(r, g, b);
|
||||
};
|
||||
|
||||
applyBoardColor();
|
||||
|
||||
return {
|
||||
onOptionsUpdated: ([k, v]) => {
|
||||
applyFrameColor();
|
||||
applyBoardColor();
|
||||
},
|
||||
interactions: {},
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue