28 lines
857 B
Lua
28 lines
857 B
Lua
|
local Action_GameActive = {
|
||
|
-- 启动服务器准备倒计时
|
||
|
}
|
||
|
|
||
|
function Action_GameActive:Execute()
|
||
|
GameState:ChangeGameProgressState(DefaultSettings.EGameProgress.PREPARE);
|
||
|
self.ConstCurrTime = MiniGameTimes.Active;
|
||
|
self.GameTime = self.ConstCurrTime
|
||
|
self.CountTime = math.floor(self.ConstCurrTime);
|
||
|
return true;
|
||
|
end
|
||
|
|
||
|
function Action_GameActive:Update(DeltaSeconds)
|
||
|
self.GameTime = self.GameTime - DeltaSeconds
|
||
|
local CurrTime = math.floor(self.GameTime);
|
||
|
if CurrTime ~= self.CountTime then
|
||
|
UGCGameSystem.GameState:OnGameProgress_Tick(CurrTime);
|
||
|
UGCGameSystem.GameState:OnBeforeGameStart(CurrTime);
|
||
|
self.CountTime = CurrTime;
|
||
|
end
|
||
|
if self.CountTime <= 0 then
|
||
|
self.bEnableActionTick = false;
|
||
|
-- 通知一下等待结束了
|
||
|
GameState:ChangeGameProgressState(DefaultSettings.EGameProgress.GAMING);
|
||
|
end
|
||
|
end
|
||
|
|
||
|
return Action_GameActive
|