miduo_client/Assets/ManagedResources/~Lua/Modules/Story/StoryMapManager.lua

40 lines
1.1 KiB
Lua
Raw Normal View History

2021-04-26 09:41:41 +08:00
StoryMapManager = {}
local this = StoryMapManager
this.groupConfigs = {}
2021-04-29 17:00:12 +08:00
this.isShowStory = 0
2021-04-26 09:41:41 +08:00
local storyMapConfig = ConfigManager.GetConfig(ConfigName.StoryMapConfig)
--初始化
function this.Initialize()
end
function this.InitData(groupId)
2021-04-26 18:29:47 +08:00
this.groupConfigs = {}
2021-04-26 09:41:41 +08:00
this.InitGroupIds(groupId)
this.GetSingleStoryConfig()
end
2021-04-26 18:29:47 +08:00
function this.InitGroupIds(groupId)
2021-04-26 09:41:41 +08:00
local config = storyMapConfig[groupId]
table.insert(this.groupConfigs,config)
if config.NextId and config.NextId > 0 then
this.InitGroupIds(config.NextId)
end
end
function this.GetSingleStoryConfig()
local config = {}
if #this.groupConfigs > 0 then
config = this.groupConfigs[1]
if UIManager.IsOpen(UIName.StoryMapPanel) then
UIManager.ClosePanel(UIName.StoryMapPanel)
end
UIManager.OpenPanel(UIName.StoryMapPanel,config)
table.remove(this.groupConfigs,1)
else
2021-04-29 17:44:35 +08:00
StoryMapManager.isShowStory = 0
2021-04-26 09:41:41 +08:00
Game.GlobalEvent:DispatchEvent(GameEvent.GuaJi.CloseStoryMapPanel)
end
end
return this