Skip to content

Commit 0e7df80

Browse files
committed
serialize/unserialize uniform...
1 parent 3e0d0e5 commit 0e7df80

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/nodes/input/ValueNode.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,16 @@ export class ValueNode extends UniformBaseNode {
2222
protected override getUniformJsValue(): string {
2323
return this.inputValue.stringValue;
2424
}
25+
26+
override serialize(): Record<string, any> {
27+
return {
28+
...super.serialize(),
29+
value: this.inputValue.value
30+
}
31+
}
32+
33+
override unserialize(data: Record<string, any>): void {
34+
super.unserialize(data);
35+
this.inputValue.value = Number( data.value );
36+
}
2537
}

0 commit comments

Comments
 (0)