饥荒mod吧 关注:57,786贴子:235,512
  • 6回复贴,共1

『01-17』【问题求助】请问函数中2种行为之间加延时有什么办法么

只看楼主收藏回复

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()会报错)


IP属地:吉林1楼2016-01-17 01:41回复
    楼主啊,我想给武器mod右键也加上功能,该用些什么函数啊领进门给个大概就够了,我会全局搜索模仿代码


    IP属地:浙江来自Android客户端3楼2016-01-18 12:46
    收起回复