Skip to content

Commit

Permalink
修暂停界面没有在需要的时候unload游戏数据
Browse files Browse the repository at this point in the history
框架跟进
  • Loading branch information
MrZ626 committed Jul 12, 2024
1 parent 56563f1 commit d4060e4
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Zenitha
Submodule Zenitha updated 1 files
+1 −1 debug.lua
5 changes: 5 additions & 0 deletions assets/scene/game_in.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ function scene.load()
scene.widgetList.pause.text=canPause() and CHAR.icon.pause or CHAR.icon.back
WIDGET._reset()
end
function scene.unload()
if SCN.state.target~='pause_in' then
GAME.unload()
end
end

local function sysAction(action)
if action=='restart' then
Expand Down
5 changes: 5 additions & 0 deletions assets/scene/game_out.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ function scene.load()
scene.widgetList.pause.text=canPause() and CHAR.icon.pause or CHAR.icon.back
WIDGET._reset()
end
function scene.unload()
if SCN.state.target~='pause_out' then
GAME.unload()
end
end

local function sysAction(action)
if action=='restart' then
Expand Down
5 changes: 4 additions & 1 deletion assets/scene/pause_in.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ local scene={}
local pauseText

local function fuse()
repeat DEBUG.yieldT(6.26) until SCN.cur~='pause_out'
repeat DEBUG.yieldT(6.26) until SCN.cur~='pause_in'
FMOD.effect.keyOff('music_pause')
end

Expand All @@ -16,6 +16,9 @@ function scene.load()
end
function scene.unload()
FMOD.effect.keyOff('music_pause')
if not (SCN.state.target=='setting_in' or SCN.state.target=='game_in') then
GAME.unload()
end
end

local function sysAction(action)
Expand Down
3 changes: 3 additions & 0 deletions assets/scene/pause_out.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ function scene.load()
end
function scene.unload()
FMOD.effect.keyOff('music_pause')
if not (SCN.state.target=='setting_out' or SCN.state.target=='game_out') then
GAME.unload()
end
end

local function sysAction(action)
Expand Down

0 comments on commit d4060e4

Please sign in to comment.