daily pastebin goal
93%
SHARE
TWEET

Untitled

a guest Jan 12th, 2018 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- abstract singleton object for managing animation stuff
  2. -- see StarterPack.AnimationOverload
  3.  
  4. local Animation = {
  5.     keyframeReachedEvents = {}
  6. }
  7.  
  8. function Animation:BindKeyframeReachedEvent(animationName, keyframeName, fn)
  9.     local list = self.keyframeReachedEvents[animationName]
  10.     if not list then
  11.         list = {}
  12.         self.keyframeReachedEvents[animationName] = list
  13.     end
  14.     list[keyframeName] = fn
  15. end
  16.  
  17. function Animation:UnbindKeyframeReachedEvent(animationName, keyframeName)
  18.     local list = self.keyframeReachedEvents[animationName]
  19.     if not list then return end
  20.     list[keyframeName] = nil
  21. end
  22.  
  23.  
  24. return Animation
RAW Paste Data
Top