dkm
Ripped a part utility folder and shoved it into a lib. Changed a lot of Utility prefixes to the modules name. This contains breaking changes. Scripts that use 0.2.0 will need to update to match the new format
This commit is contained in:
1 parent
a08c22afed
commit
84480f8939
36 files changed
+2523
-97
No files matched your search
@@ -0,0 +1,35 @@
|
||||
local ReboundEntities = ReboundEntities or Require("shared/rebound_entities.lua")
|
||||
local Actions = Actions or Require("shared/actions.lua")
|
||||
local LA = LA or Require("shared/la.lua")
|
||||
|
||||
REA = {}
|
||||
|
||||
if not IsDuplicityVersion() then goto client end
|
||||
|
||||
|
||||
|
||||
if IsDuplicityVersion() then return end
|
||||
::client::
|
||||
|
||||
local ActionsInProgress = {}
|
||||
|
||||
|
||||
Action.Create("LerpToPosition", function(reboundId, start, position, duration, shouldRepeat, overrideStartTime)
|
||||
local re = ReboundEntities.Get(reboundId)
|
||||
assert(re, "Rebound entity not found")
|
||||
local entity = re and re.entity
|
||||
if not entity then return end
|
||||
local startTime = GetGameTimer()
|
||||
local endTime = overrideStartTime or startTime + duration
|
||||
ActionsInProgress[reboundId] = {reboundId, start, position, duration, shouldRepeat, startTime}
|
||||
local t = 0
|
||||
CreateThread(function()
|
||||
while shouldRepeat or t < 1 do
|
||||
t = (GetGameTimer() - startTime) / duration
|
||||
local lerpPosition = LA.LerpVector(start, position, t)
|
||||
SetEntityCoords(entity, lerpPosition)
|
||||
Wait(0)
|
||||
|
||||
end
|
||||
end)
|
||||
end)
|
||||
Reference in new issue
Block a user