I'm using p2 in a React component. I want to ensure that when the component unmounts that the p2 instance is no longer running.
Aside from removing event listeners and cancelling the requestAnimationFrame loop, is there anything specific that needs to be called to tell p2 that it's done? Something like a destroy() method?
I've noticed p2 has a method called "clear" - is this what I'm after?
I'm using p2 in a React component. I want to ensure that when the component unmounts that the p2 instance is no longer running.
Aside from removing event listeners and cancelling the requestAnimationFrame loop, is there anything specific that needs to be called to tell p2 that it's done? Something like a destroy() method?
I've noticed p2 has a method called "clear" - is this what I'm after?