Files
Main/Assets/GameAssets/Resources/Lua/Logic/BlockingUpPrompt/BlockingUpPromptFlyTeleport.lua

55 lines
1.6 KiB
Lua
Raw Normal View History

2025-01-25 04:38:09 +08:00
------------------------------------------------
--作者: yangqf
--日期: 2021-04-09
--文件: BlockingUpPromptFlyTeleport.lua
--模块: BlockingUpPromptFlyTeleport
--描述: 飞行传送
------------------------------------------------
local L_BlockingUpPromptBase = require "Logic.BlockingUpPrompt.BlockingUpPromptBase"
local L_EntityStateID = CS.Thousandto.Core.Asset.EntityStateID
local BlockingUpPromptFlyTeleport = {
DataId = 0,
}
function BlockingUpPromptFlyTeleport:New(dataId, endCallBack)
local _n = Utils.DeepCopy(self)
local _m = setmetatable(_n, {
__index = L_BlockingUpPromptBase:New(BlockingUpPromptType.FlyTeleport, endCallBack)
})
_m.DataId = dataId
_m.PromptState = BlockingUpPromptState.Initialize
return _m
end
function BlockingUpPromptFlyTeleport:Start()
local _lp = GameCenter.GameSceneSystem:GetLocalPlayer()
local _succ = false
if _lp ~= nil then
_succ = _lp:Action_FlyTeleport(self.DataId)
end
if _succ then
self.PromptState = BlockingUpPromptState.Running
else
self.PromptState = BlockingUpPromptState.Finish
end
end
function BlockingUpPromptFlyTeleport:Update(dt)
local _lp = GameCenter.GameSceneSystem:GetLocalPlayer()
if _lp ~= nil then
if not _lp:IsXState(L_EntityStateID.FlyTeleport) then
self.PromptState = BlockingUpPromptState.Finish
end
else
self.PromptState = BlockingUpPromptState.Finish
end
end
function BlockingUpPromptFlyTeleport:End()
self:DoBaseEnd()
end
return BlockingUpPromptFlyTeleport