mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-27 06:04:35 +02:00
wip
This commit is contained in:
@@ -3,18 +3,38 @@
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import * as BABYLON from '@babylonjs/core';
|
||||
import { defineObject } from '../engine.js';
|
||||
|
||||
export const desk = defineObject({
|
||||
id: 'desk',
|
||||
name: 'Desk',
|
||||
options: {
|
||||
schema: {},
|
||||
default: {},
|
||||
schema: {
|
||||
topColor: {
|
||||
type: 'color',
|
||||
label: 'Top color',
|
||||
},
|
||||
},
|
||||
default: {
|
||||
topColor: [0, 0, 0],
|
||||
},
|
||||
},
|
||||
placement: 'floor',
|
||||
createInstance: () => {
|
||||
createInstance: ({ options, findMaterial }) => {
|
||||
const topMaterial = findMaterial('__X_BODY__');
|
||||
|
||||
const applyTopColor = () => {
|
||||
const [r, g, b] = options.topColor;
|
||||
topMaterial.albedoColor = new BABYLON.Color3(r, g, b);
|
||||
};
|
||||
|
||||
applyTopColor();
|
||||
|
||||
return {
|
||||
onOptionsUpdated: ([k, v]) => {
|
||||
applyTopColor();
|
||||
},
|
||||
interactions: {},
|
||||
};
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user