import { Scene } from '@babylonjs/core/scene.js' ; import { PropChangeType , PropertyUpdate , PropsHandler , UpdatePayload } from '../PropsHandler' ; export default class TargetPropsHandler implements PropsHandler < any > { constructor ( private scene ) { } getPropertyUpdates ( oldProps , newProps ) { const propertyUpdates = [ ] ; if ( ! oldProps . lockedTargetMeshName || oldProps . lockedTargetMeshName !== newProps . lockedTargetMeshName ) { if ( typeof newProps . lockedTargetMeshName === 'string' ) { propertyUpdates . push ( { changeType : PropChangeType . Primitive , propertyName : 'lockedTarget' , value : this . scene . getMeshByName ( newProps . lockedTargetMeshName ) , } ) ; } } return propertyUpdates ; } }