예제 #1
0
 // Generic Constructor
 public HiraTween(float time,
                  Action <float> onIteration,
                  HiraTweenterpolationType tweenType = HiraTweenterpolationType.Linear,
                  HiraTweenEaseType easeType         = HiraTweenEaseType.EaseIn,
                  Action onCompletion = null)
 {
     Time         = time;
     OnIteration  = onIteration;
     TweenType    = tweenType;
     EaseType     = easeType;
     OnCompletion = onCompletion;
 }
예제 #2
0
 // Vector2 Tween Constructor
 public HiraTween(Action <Vector2> setter,
                  Vector2 a,
                  Vector2 b,
                  float time,
                  HiraTweenterpolationType tweenType = HiraTweenterpolationType.Linear,
                  HiraTweenEaseType easeType         = HiraTweenEaseType.EaseIn,
                  Action onCompletion = null)
 {
     Time         = time;
     OnIteration  = t => setter(Vector2.LerpUnclamped(a, b, t));
     OnCompletion = onCompletion;
     TweenType    = tweenType;
     EaseType     = easeType;
 }
예제 #3
0
 // Quaternion Tween Constructor
 public HiraTween(Action <Quaternion> setter,
                  Quaternion a,
                  Quaternion b,
                  float time,
                  HiraTweenterpolationType tweenType = HiraTweenterpolationType.Linear,
                  HiraTweenEaseType easeType         = HiraTweenEaseType.EaseIn,
                  Action onCompletion = null)
 {
     Time         = time;
     OnIteration  = t => setter(Quaternion.SlerpUnclamped(a, b, t));
     OnCompletion = onCompletion;
     TweenType    = tweenType;
     EaseType     = easeType;
 }
예제 #4
0
 // Euler Tween Constructor
 public HiraTween(Action <Vector3> setter,
                  Quaternion a,
                  Quaternion b,
                  float time,
                  HiraTweenterpolationType tweenType = HiraTweenterpolationType.Linear,
                  HiraTweenEaseType easeType         = HiraTweenEaseType.EaseIn,
                  Action onCompletion = null)
 {
     Time         = time;
     var(x, y)    = (a.eulerAngles, b.eulerAngles);
     OnIteration  = t => setter(Vector3.SlerpUnclamped(x, y, t));
     OnCompletion = onCompletion;
     TweenType    = tweenType;
     EaseType     = easeType;
 }