This commit is contained in:
syuilo
2026-02-19 19:09:00 +09:00
parent 376bb328df
commit d01b3036d6
2 changed files with 20 additions and 16 deletions

View File

@@ -82,8 +82,10 @@ type GetOptionsSchemaValues<T extends OptionsSchema> = {
type ObjectDef<OpSc extends OptionsSchema> = {
id: string;
optionsSchema: OpSc;
defaultOptions: GetOptionsSchemaValues<OpSc>;
options: {
schema: OpSc;
default: GetOptionsSchemaValues<OpSc>;
};
placement: 'top' | 'side' | 'bottom' | 'wall' | 'ceiling' | 'floor';
isChair?: boolean;
createInstance: (args: {
@@ -1097,7 +1099,7 @@ export class RoomEngine {
type,
position: new BABYLON.Vector3(0, 0, 0),
rotation: new BABYLON.Vector3(0, Math.PI, 0),
options: def.defaultOptions,
options: def.options.default,
});
const ghost = this.createGhost(root);
@@ -1145,7 +1147,7 @@ export class RoomEngine {
position: [pos.x, pos.y, pos.z],
rotation: [rotation.x, rotation.y, rotation.z],
sticky,
options: def.defaultOptions,
options: def.options.default,
});
},
};

View File

@@ -9,21 +9,23 @@ import { get7segMeshesOfCurrentTime } from '../utility.js';
export const tabletopDigitalClock = defineObject({
id: 'tabletopDigitalClock',
optionsSchema: {
bodyStyle: {
type: 'select',
label: 'Body Style',
enum: ['color', 'wood'],
options: {
schema: {
bodyStyle: {
type: 'select',
label: 'Body Style',
enum: ['color', 'wood'],
},
bodyColor: {
type: 'color',
label: 'Body Color',
},
},
bodyColor: {
type: 'color',
label: 'Body Color',
default: {
bodyStyle: 'color',
bodyColor: [0.45, 0.8, 0],
},
},
defaultOptions: {
bodyStyle: 'color',
bodyColor: [0.45, 0.8, 0],
},
placement: 'top',
createInstance: ({ room, options, root }) => {
return {