Files
apt-nl-map/static/Magic4/js/three.js-dev/examples/jsm/nodes/inputs/PropertyNode.js

48 lines
613 B
JavaScript
Raw Normal View History

2024-12-04 10:21:04 +08:00
import { InputNode } from '../core/InputNode.js';
class PropertyNode extends InputNode {
constructor( object, property, type ) {
super( type );
this.object = object;
this.property = property;
}
get value() {
return this.object[ this.property ];
}
set value( val ) {
this.object[ this.property ] = val;
}
toJSON( meta ) {
let data = this.getJSONNode( meta );
if ( ! data ) {
data = this.createJSONNode( meta );
data.value = this.value;
data.property = this.property;
}
return data;
}
}
PropertyNode.prototype.nodeType = 'Property';
export { PropertyNode };