local function spawntornado(staff, target, pos)
---------------------
--释放旋风
---------------------
local tornado = SpawnPrefab("tornado")
tornado.WINDSTAFF_CASTER = staff.components.inventoryitem.owner
local spawnPos = staff:GetPosition() + TheCamera:GetDownVec()
local totalRadius = target.Physics and target.Physics:GetRadius() or 0.5 + tornado.Physics:GetRadius() + 0.5
local targetPos = target:GetPosition() + (TheCamera:GetDownVec() * totalRadius)
tornado.Transform:SetPosition(getspawnlocation(staff, target):Get())
tornado.components.knownlocations:RememberLocation("target", targetPos)
---------------------
--传送
---------------------
local pt = target:GetPosition()
local owner = staff.components.inventoryitem.owner
owner.Transform:SetPosition(pt.x, pt.y, pt.z)
end
请教大神在上述施放旋风和传送的2种动作间加入延时有什么方法么?
(PS:直接加Sleep()会报错)
---------------------
--释放旋风
---------------------
local tornado = SpawnPrefab("tornado")
tornado.WINDSTAFF_CASTER = staff.components.inventoryitem.owner
local spawnPos = staff:GetPosition() + TheCamera:GetDownVec()
local totalRadius = target.Physics and target.Physics:GetRadius() or 0.5 + tornado.Physics:GetRadius() + 0.5
local targetPos = target:GetPosition() + (TheCamera:GetDownVec() * totalRadius)
tornado.Transform:SetPosition(getspawnlocation(staff, target):Get())
tornado.components.knownlocations:RememberLocation("target", targetPos)
---------------------
--传送
---------------------
local pt = target:GetPosition()
local owner = staff.components.inventoryitem.owner
owner.Transform:SetPosition(pt.x, pt.y, pt.z)
end
请教大神在上述施放旋风和传送的2种动作间加入延时有什么方法么?
(PS:直接加Sleep()会报错)