Exemple #1
0
    public static Tweener MoveTo(this Transform t, Vector3 position, float duration, Func <float, float, float, float> equation)
    {
        TransformPositionTweener tweener = t.gameObject.AddComponent <TransformPositionTweener> ();

        tweener.startTweenValue = t.position;
        tweener.endTweenValue   = position;
        tweener.duration        = duration;
        tweener.equation        = equation;
        tweener.Play();
        return(tweener);
    }
Exemple #2
0
    public static Tweener MoveToUsingCurve(this Transform t, Vector3 position, float duration, AnimationCurve curve)
    {
        TransformPositionTweener tweener = t.gameObject.AddComponent <TransformPositionTweener>();

        tweener.StartTweenValue   = t.position;
        tweener.EndTweenValue     = position;
        tweener.duration          = duration;
        tweener.curve             = curve;
        tweener.useAnimationCurve = true;
        tweener.Play();
        return(tweener);
    }