daily pastebin goal
76%
SHARE
TWEET

Untitled

a guest Jan 12th, 2018 50 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
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top