mirror of
https://github.com/jiojciojsioe3/a3cjroijsiojiorj.git
synced 2024-11-15 07:21:50 +08:00
Fix view not cleaning some variables
This commit is contained in:
parent
f90f6fe6e1
commit
378e275372
@ -1286,22 +1286,26 @@
|
|||||||
return this.controller.getElapsedTime()
|
return this.controller.getElapsedTime()
|
||||||
}
|
}
|
||||||
clean(){
|
clean(){
|
||||||
|
this.draw.clean()
|
||||||
|
this.assets.clean()
|
||||||
|
this.titleCache.clean()
|
||||||
this.comboCache.clean()
|
this.comboCache.clean()
|
||||||
|
|
||||||
if(this.multiplayer !== 2){
|
if(this.multiplayer !== 2){
|
||||||
pageEvents.remove(window, "resize")
|
pageEvents.remove(window, "resize")
|
||||||
|
if(this.touchEnabled){
|
||||||
|
pageEvents.remove(this.canvas, "touchstart")
|
||||||
|
pageEvents.remove(this.touchFullBtn, "touchend")
|
||||||
|
pageEvents.remove(this.touchPauseBtn, "touchend")
|
||||||
|
this.gameDiv.classList.remove("touch-visible")
|
||||||
|
document.getElementById("version").classList.remove("version-hide")
|
||||||
|
delete this.touchDrumDiv
|
||||||
|
delete this.touchDrumImg
|
||||||
|
delete this.touchFullBtn
|
||||||
|
delete this.touchPauseBtn
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(this.touchEnabled){
|
pageEvents.mouseRemove(this)
|
||||||
pageEvents.remove(this.canvas, "touchstart")
|
|
||||||
pageEvents.remove(this.touchFullBtn, "touchend")
|
|
||||||
pageEvents.remove(this.touchPauseBtn, "touchend")
|
|
||||||
this.gameDiv.classList.remove("touch-visible")
|
|
||||||
document.getElementById("version").classList.remove("version-hide")
|
|
||||||
delete this.touchDrumDiv
|
|
||||||
delete this.touchDrumImg
|
|
||||||
delete this.touchFullBtn
|
|
||||||
delete this.touchPauseBtn
|
|
||||||
}
|
|
||||||
delete this.pauseMenu
|
delete this.pauseMenu
|
||||||
delete this.cursor
|
delete this.cursor
|
||||||
delete this.gameDiv
|
delete this.gameDiv
|
||||||
|
@ -131,4 +131,11 @@ class ViewAssets{
|
|||||||
asset.changeBeatInterval(beatMS, initial)
|
asset.changeBeatInterval(beatMS, initial)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
clean(){
|
||||||
|
delete this.ctx
|
||||||
|
delete this.don
|
||||||
|
delete this.fire
|
||||||
|
delete this.fireworks
|
||||||
|
delete this.allAssets
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user