Beispiel #1
0
    /// <summary>
    /// Start the tweening operation.
    /// </summary>

    static public TweenAbsPosition Begin(GameObject go, float duration, Vector3 pos)
    {
        TweenAbsPosition comp = GeekTweener.Begin <TweenAbsPosition>(go, duration);

        comp.from = comp.position;
        comp.to   = pos;
        if (duration <= 0f)
        {
            comp.Sample(1f, true);
            comp.enabled = false;
        }
        return(comp);
    }
Beispiel #2
0
    /// <summary>
    /// Start the tweening operation.
    /// </summary>

    static public GeekTweenScale Begin(GameObject go, float duration, Vector3 scale)
    {
        GeekTweenScale comp = GeekTweener.Begin <GeekTweenScale>(go, duration);

        comp.from = comp.scale;
        comp.to   = scale;

        if (duration <= 0f)
        {
            comp.Sample(1f, true);
            comp.enabled = false;
        }
        return(comp);
    }
Beispiel #3
0
    /// <summary>
    /// Start the tweening operation.
    /// </summary>

    static public GeekTweenRotation Begin(GameObject go, float duration, Quaternion rot)
    {
        GeekTweenRotation comp = GeekTweener.Begin <GeekTweenRotation>(go, duration);

        comp.from = comp.rotation.eulerAngles;
        comp.to   = rot.eulerAngles;

        if (duration <= 0f)
        {
            comp.Sample(1f, true);
            comp.enabled = false;
        }
        return(comp);
    }
Beispiel #4
0
    /// <summary>
    /// Start the tweening operation.
    /// </summary>

    static public GeekTweenValue Begin(GameObject go, float duration, float from, float to, GameObject receiver, string fun)
    {
        GeekTweenValue comp = GeekTweener.Begin <GeekTweenValue>(go, duration);

        comp.from     = from;
        comp.to       = to;
        comp.fun      = fun;
        comp.receiver = receiver;
        if (duration <= 0f)
        {
            comp.Sample(1f, true);
            comp.enabled = false;
        }
        return(comp);
    }