Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function Chain_OnUpdate(self, elapsed)
- if (self.chainPause) then
- return;
- end
- local rev = self.chainRev;
- local e = self.chainElapsed + elapsed;
- self.chainElapsed = e;
- local points = 3;
- local off = {self.chainY+20, -30, 10};
- local dur = {self.chainY/400, 0.2, 0.3};
- local tDur = 0;
- for i = 1, points do
- tDur = tDur + dur[i];
- end
- e = math.min(e, tDur);
- if (rev) then
- e = math.max(0, tDur - e);
- end
- local aDur = 0;
- local y = -10;
- if (e > 0) then
- for i = 1, points do
- if (e < aDur + dur[i]) then
- y = y + off[i] * ((e - aDur) / dur[i]);
- pause = false;
- break;
- else
- y = y + off[i];
- end
- aDur = aDur + dur[i];
- end
- end
- self:SetPoint("BOTTOMLEFT", UIParent, "TOPLEFT", self:GetLeft(), -y);
- if ((rev and e == 0) or (not rev and e == tDur)) then
- self.chainRev = not rev;
- self.chainPause = true;
- self.chainElapsed = 0;
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement