Exemple #1
0
        IEnumerator testUpDownImpl()
        {
            TweenAttr.SetAttr fn = new TweenAttr.SetAttr(SetHeight);

            TweenAttr.Begin(gameObject, fn, 3, 10, 2);
            yield return(new WaitForSeconds(3));



            TweenAttr.Begin(gameObject, fn, 3, 2, 10);
            yield return(new WaitForSeconds(3));

            yield return(true);
        }
Exemple #2
0
    static public TweenAttr Begin(GameObject go, SetAttr fnAttr, float duration, float from, float to)
    {
        TweenAttr comp = UITweener.Begin <TweenAttr>(go, duration);

        comp.from   = from;
        comp.to     = to;
        comp.count  = to - from;
        comp.fnAttr = fnAttr;
        //comp.value = from;

        if (duration <= 0f)
        {
            comp.Sample(1f, true);
            comp.enabled = false;
        }

        return(comp);
    }