mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
Unsubscribe removed Navara effects and models from warm view frames
This commit is contained in:
1 parent
14f7b32537
commit
05b646daa3
16 files changed
+90
-19
No files matched your search
@@ -0,0 +1,18 @@
|
||||
// Navara auto-binds descriptor.update on creation but does not unregister
|
||||
// that bound function when its handle is deleted. GEV's synchronous effects
|
||||
// and meshes subscribe with their own callback so a parked view can be reused.
|
||||
export function withFrameUpdates(Base) {
|
||||
return class extends Base {
|
||||
#frame = (time) => this.updateFrame(time);
|
||||
|
||||
onCreate() {
|
||||
super.onCreate();
|
||||
this.view.on('preRender', this.#frame);
|
||||
}
|
||||
|
||||
onDestroy() {
|
||||
this.view.off('preRender', this.#frame);
|
||||
super.onDestroy();
|
||||
}
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user