Closed Starsky-Synlitec closed 4 years ago
@Starsky-Synlitec Your suggestion to provide unload method is a good idea for page initiation of the plugin, but in general we recommend to config the plugin on App onload method. And even for page, you don't need to dispose the plugin, since the offscreen canvas should be app scoped. You can check if the backend is already set by calling tf.getBackend() and check if it is 'wechat-webgl', unless you have supply your own backend name.
There is a function :configplugin to initialize this plugin. But when the page released or app turned off, is there a function to dispose all the resourcesd used ? If I call the config function in onload method, when I turn to another page close this page and open again, the onload function will be called once more. So this plugin is configed again ? A new offscreen canvas will be created ? How to dispose the previous one ?