67 lines
1.6 KiB
Lua
67 lines
1.6 KiB
Lua
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 --当前比赛场次
|
|
this.curResultId = 1 --当前剧本Id
|
|
this.curRecordList = 0 --当前纪录数据
|
|
this.curBetList = 0 --当前竞猜数据
|
|
this.CloseMap()
|
|
end
|
|
|
|
--初始化地图
|
|
function this.OpenMap()
|
|
local playerData = ConfigManager.GetConfigDataByKey(ConfigName.RidingSwardResult,"Id",this.curResultId)
|
|
if not this.riceCtrl then
|
|
this.riceCtrl = riceCtrl:New()
|
|
this.riceCtrl:Awake(bgList,playerData)
|
|
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
|
|
end
|
|
-- --销毁地图--立刻
|
|
-- function this.DestroyMap()
|
|
-- if this.riceCtrl then
|
|
-- this.riceCtrl:Dispose()
|
|
-- this.riceCtrl = nil
|
|
-- end
|
|
-- end
|
|
|
|
--更新服务器信息
|
|
function this.UpdataServerData(msg)
|
|
-- body
|
|
end
|
|
|
|
--修改游戏状态
|
|
function this.SetGameState(_state)
|
|
this.riceCtrl:SetGameState(_state)
|
|
end
|
|
|
|
--游戏结束 重置
|
|
function this.FinishResetGame()
|
|
Timer.New(function ()
|
|
UIManager.OpenPanel(UIName.GeneralBigPopup,GENERAL_POPUP_TYPE.YuJianLastResult)
|
|
this.ResetGame()
|
|
end,0.3):Start()
|
|
end
|
|
|
|
--重置游戏
|
|
function this.ResetGame()
|
|
this.riceCtrl:ResetGame()
|
|
end
|
|
|
|
|
|
return YuJianXingManager |