Version
Description
If the Animation Manager is stringified indirectly, toJSON() will probably error because it interprets its key argument as animation identifier.
This came up when someone used a serialization library on a scene.
Example Test Code
In a scene:
JSON.stringify([ this.anims ]) // → toJSON("0")
// Uncaught TypeError: can't access property "toJSON", this.anims.get(...) is undefined
JSON.stringify({ anims: this.anims }) // → toJSON("anims")
// Uncaught TypeError: can't access property "toJSON", this.anims.get(...) is undefined
Additional Information
Probably best to remove the key argument from toJSON() and add a getJSON(animKey) method instead.
Version
Description
If the Animation Manager is stringified indirectly,
toJSON()will probably error because it interprets itskeyargument as animation identifier.This came up when someone used a serialization library on a scene.
Example Test Code
In a scene:
Additional Information
Probably best to remove the
keyargument fromtoJSON()and add agetJSON(animKey)method instead.