mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-24 18:34:09 +02:00
wip
This commit is contained in:
Binary file not shown.
Binary file not shown.
BIN
packages/frontend/assets/room/objects/cactus-s/textures/soil.png
Normal file
BIN
packages/frontend/assets/room/objects/cactus-s/textures/soil.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
@@ -3,18 +3,39 @@
|
|||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import * as BABYLON from '@babylonjs/core';
|
||||||
import { defineObject } from '../engine.js';
|
import { defineObject } from '../engine.js';
|
||||||
|
|
||||||
export const cactusS = defineObject({
|
export const cactusS = defineObject({
|
||||||
id: 'cactusS',
|
id: 'cactusS',
|
||||||
name: 'Cactus S',
|
name: 'Cactus S',
|
||||||
options: {
|
options: {
|
||||||
schema: {},
|
schema: {
|
||||||
default: {},
|
potColor: {
|
||||||
|
type: 'color',
|
||||||
|
label: 'Pot color',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
default: {
|
||||||
|
potColor: [0.45, 0.45, 0.45],
|
||||||
|
},
|
||||||
},
|
},
|
||||||
placement: 'top',
|
placement: 'top',
|
||||||
createInstance: () => {
|
createInstance: ({ options, root }) => {
|
||||||
|
const potMesh = root.getChildMeshes().find(m => m.name.includes('__X_POT__')) as BABYLON.Mesh;
|
||||||
|
const potMaterial = potMesh.material as BABYLON.PBRMaterial;
|
||||||
|
|
||||||
|
const applyPotColor = () => {
|
||||||
|
const [r, g, b] = options.potColor;
|
||||||
|
potMaterial.albedoColor = new BABYLON.Color3(r, g, b);
|
||||||
|
};
|
||||||
|
|
||||||
|
applyPotColor();
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
onOptionsUpdated: ([k, v]) => {
|
||||||
|
applyPotColor();
|
||||||
|
},
|
||||||
interactions: {},
|
interactions: {},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user