miduo_client/Assets/ManagedResources/~Lua/Modules/YuJianXing/YuJianXingManager.lua

67 lines
1.6 KiB
Lua
Raw Normal View History

2021-09-29 18:34:54 +08:00
YuJianXingManager = {}
local this = YuJianXingManager
local riceCtrl = require("Modules/YuJianXing/RiceCtrlView")
local bgList = {"y_yujianxing_bg","y_yujianxing_bg","y_yujianxing_bg","y_yujianxing_bg"}
function this.Initialize()
this.curState = 0 --当前比赛状态
this.nextSession = 0 --当前比赛场次
2021-10-08 20:49:25 +08:00
this.curResultId = 1 --当前剧本Id
2021-09-29 18:34:54 +08:00
this.curRecordList = 0 --当前纪录数据
this.curBetList = 0 --当前竞猜数据
2021-10-08 20:49:25 +08:00
this.CloseMap()
2021-09-29 18:34:54 +08:00
end
2021-10-08 15:45:28 +08:00
--初始化地图
function this.OpenMap()
2021-10-08 20:49:25 +08:00
local playerData = ConfigManager.GetConfigDataByKey(ConfigName.RidingSwardResult,"Id",this.curResultId)
2021-10-08 15:45:28 +08:00
if not this.riceCtrl then
this.riceCtrl = riceCtrl:New()
2021-10-08 20:49:25 +08:00
this.riceCtrl:Awake(bgList,playerData)
2021-10-08 15:45:28 +08:00
end
if this.timer then
this.timer:Stop()
this.timer = nil
end
end
--销毁地图--正常
function this.CloseMap()
if this.riceCtrl then
this.riceCtrl:Dispose()
this.riceCtrl = nil
end
2021-09-29 18:34:54 +08:00
end
2021-10-08 20:49:25 +08:00
-- --销毁地图--立刻
-- function this.DestroyMap()
-- if this.riceCtrl then
-- this.riceCtrl:Dispose()
-- this.riceCtrl = nil
-- end
-- end
2021-09-29 18:34:54 +08:00
2021-10-08 15:45:28 +08:00
--更新服务器信息
function this.UpdataServerData(msg)
-- body
2021-09-29 18:34:54 +08:00
end
2021-10-08 15:45:28 +08:00
--修改游戏状态
2021-09-29 18:34:54 +08:00
function this.SetGameState(_state)
this.riceCtrl:SetGameState(_state)
end
2021-10-08 20:49:25 +08:00
--游戏结束 重置
function this.FinishResetGame()
Timer.New(function ()
UIManager.OpenPanel(UIName.GeneralBigPopup,GENERAL_POPUP_TYPE.YuJianLastResult)
this.ResetGame()
end,0.3):Start()
end
2021-10-08 15:45:28 +08:00
--重置游戏
function this.ResetGame()
this.riceCtrl:ResetGame()
2021-09-29 18:34:54 +08:00
end
2021-10-08 15:45:28 +08:00
2021-09-29 18:34:54 +08:00
return YuJianXingManager