Open yamayuski opened 2 years ago
/** * @link https://github.com/BabylonJS/Babylon.js/blob/master/packages/dev/core/src/Rendering/outlineRenderer.ts */ declare module "@babylonjs/core/scene" { export interface Scene { _vrmFinder: VRMFinder; getVRMFinder(): VRMFinder; } } Scene.prototype.getVRMFinder = function (): VRMFinder { if (!this._vrmFinder) { this._vrmFinder = new VRMFinder(this); } return this._vrmFinder; }; export class VRMFinder implements ISceneComponent { public name = 'VRMFinder'; public constructor(public readonly scene: Scene) { this.scene._addComponent(this); } public getByTitle(title: string): Nullable<VRMManager> { // ... } public getAll(): VRMManager[] { // ... } // ... }
恐らくこんな感じのインターフェースを想定。
// use case const vrm = this.scene.getByTitle('Alicia Solid') ?? throw new Error(`VRM not found`); vrm.morphing('a', 1.0);
恐らくこんな感じのインターフェースを想定。