Skip to content

Latest commit

 

History

History
52 lines (41 loc) · 1.6 KB

README.md

File metadata and controls

52 lines (41 loc) · 1.6 KB

Unity Transform Interpolator

Interpolates transform's position, rotation, scale or a float field over a period of time.

Failed to load gif GIF frame rate is 15, actual video is not laggy

UPDATE : Added interpolation support for float variables.

Interpolation Types (inbuilt) :

  • LINEAR
  • EASE IN
  • EASE OUT

EASE IN and EASE OUT follow following equation

Failed to load image

By default strength of the curve is set to 3
You can specify it while calling AddTarget method

Attributes :

  • POSITION
  • ROTATION
  • SCALE
  • FLOAT

Optional parameters :

  • Custom interpolator function and its params
  • Ease function strength
  • Callback action

Usage :

  • Assign Interpolator.cs to a gameobject in the scene
  • Call Interpolator.AddTarget with a Transform, InterpolationType, Attribute, Target value and Period
  • It will return an ID for its animation
  • You can create custom interpolation type using (Hashtable data) => {} in AddTarget method
  • Set data["RETURN"] to the delta value that your function calculates
  • You can check whether the animation is complete using Interpolator.IsActive(id) method
  • Or you can also assign a callback which will be called after animation is complete
  • Specify it during AddTarget and give it an int parameter that will have ID of the animtion