示例#1
0
    // Token: 0x06001B8A RID: 7050 RVA: 0x000B4684 File Offset: 0x000B2884
    public static T Begin <T>(GameObject go, float duration, float delay = 0f) where T : UITweener
    {
        T t = go.GetComponent <T>();

        if (t != null && t.tweenGroup != 0)
        {
            t = (T)((object)null);
            T[] components = go.GetComponents <T>();
            int i          = 0;
            int num        = components.Length;
            while (i < num)
            {
                t = components[i];
                if (t != null && t.tweenGroup == 0)
                {
                    break;
                }
                t = (T)((object)null);
                i++;
            }
        }
        if (t == null)
        {
            t = go.AddComponent <T>();
            if (t == null)
            {
                Debug.LogError(string.Concat(new object[]
                {
                    "Unable to add ",
                    typeof(T),
                    " to ",
                    IKBQNBHOJJB.IHLEQHINJKK(go)
                }), go);
                return((T)((object)null));
            }
        }
        t.mStarted        = false;
        t.mFactor         = 0f;
        t.duration        = duration;
        t.mDuration       = duration;
        t.delay           = delay;
        t.mAmountPerDelta = ((duration <= 0f) ? 1000f : Mathf.Abs(1f / duration));
        t.style           = UITweener.DGIBNCIOKJJ.Once;
        t.animationCurve  = new AnimationCurve(new Keyframe[]
        {
            new Keyframe(0f, 0f, 0f, 1f),
            new Keyframe(1f, 1f, 1f, 0f)
        });
        t.eventReceiver    = null;
        t.callWhenFinished = null;
        t.onFinished.Clear();
        if (t.mTemp != null)
        {
            t.mTemp.Clear();
        }
        t.enabled = true;
        return(t);
    }