import { GizmoManager } from '@babylonjs/core/Gizmos/gizmoManager.js' ; import { CreatedInstance } from '../CreatedInstance' ; import { FiberGizmoManagerProps } from '../generatedProps' ; import BaseLifecycleListener from './BaseLifecycleListener' ; export default class GizmoManagerLifecycleListener extends BaseLifecycleListener < GizmoManager , FiberGizmoManagerProps > { onChildAdded ( child , parent ) { const gizmoManager = parent . hostInstance ! as GizmoManager ; if ( child . metadata && child . metadata . isGizmo !== true ) { if ( child . metadata . isNode === true ) { gizmoManager . attachToNode ( child . hostInstance ) ; } else if ( child . metadata . isMesh === true ) { gizmoManager . attachToMesh ( child . hostInstance ) ; } } } }