Пример #1
0
    private IEnumerator tweenLocalRotation2D_cr(float start, float end, float time, EaseUtils.EaseType ease, TweenUpdateHandler updateCallback = null)
    {
        this.transform.SetLocalEulerAngles(null, null, start);
        float t = 0f;

        while (t < time)
        {
            float val = t / time;
            this.transform.SetLocalEulerAngles(null, null, EaseUtils.Ease(ease, start, end, val));
            if (updateCallback != null)
            {
                updateCallback(val);
            }
            float num = t + this.LocalDeltaTime;
            yield return(null);
        }
        this.transform.SetLocalEulerAngles(null, null, end);
        if (updateCallback != null)
        {
            updateCallback(1f);
        }
        yield return(null);
    }
Пример #2
0
    private IEnumerator tweenLocalPositionY_cr(float start, float end, float time, EaseUtils.EaseType ease, TweenUpdateHandler updateCallback = null)
    {
        this.transform.SetLocalPosition(null, start, null);
        float t = 0f;

        while (t < time)
        {
            float val = t / time;
            this.transform.SetLocalPosition(null, EaseUtils.Ease(ease, start, end, val), null);
            if (updateCallback != null)
            {
                updateCallback(val);
            }
            float num = t + this.LocalDeltaTime;
            yield return(null);
        }
        this.transform.SetLocalPosition(null, end, null);
        if (updateCallback != null)
        {
            updateCallback(1f);
        }
        yield return(null);

        /*Error: Unable to find new state assignment for yield return*/
        ;
    }
Пример #3
0
 public Coroutine TweenLocalRotation2D(float start, float end, float time, EaseUtils.EaseType ease, TweenUpdateHandler updateCallback)
 {
     return(base.StartCoroutine(this.tweenLocalRotation2D_cr(start, end, time, ease, updateCallback)));
 }
Пример #4
0
    private IEnumerator tweenLocalPosition_cr(Vector2 start, Vector2 end, float time, EaseUtils.EaseType ease, TweenUpdateHandler updateCallback = null)
    {
        this.transform.localPosition = start;
        float t = 0f;

        while (t < time)
        {
            float val = t / time;
            float x   = EaseUtils.Ease(ease, start.x, end.x, val);
            float y   = EaseUtils.Ease(ease, start.y, end.y, val);
            this.transform.SetLocalPosition(x, y, 0f);
            if (updateCallback != null)
            {
                updateCallback(val);
            }
            float num = t + this.LocalDeltaTime;
            yield return(null);
        }
        this.transform.localPosition = end;
        if (updateCallback != null)
        {
            updateCallback(1f);
        }
        yield return(null);
    }
Пример #5
0
    static public IEnumerator TweenLocalPosition_cr(Transform target, Vector3 start, Vector3 end, float time, EaseUtils.EaseType ease, CupheadTime.Layer timeLayer, TweenUpdateHandler updateCallback, TweenCompletedHandler endCallback = null)
    {
        target.localPosition = start;
        float t = 0f;

        while (t < time)
        {
            float val = t / time;
            float x   = EaseUtils.Ease(ease, start.x, end.x, val);
            float y   = EaseUtils.Ease(ease, start.y, end.y, val);
            float z   = EaseUtils.Ease(ease, start.z, end.z, val);
            target.SetLocalPosition(x, y, z);
            updateCallback?.Invoke(val);
            t += CupheadTime.Delta[timeLayer];
            yield return(null);
        }
        target.localPosition = end;
        updateCallback?.Invoke(1f);
        endCallback?.Invoke();
        yield return(null);
    }
Пример #6
0
 public Coroutine TweenLocalPosition(Vector2 start, Vector2 end, float time, EaseUtils.EaseType ease, TweenUpdateHandler updateCallback)
 {
     return(base.StartCoroutine(this.tweenLocalPosition_cr(start, end, time, ease, updateCallback)));
 }
Пример #7
0
    private IEnumerator tweenPosition_cr(Vector3 start, Vector3 end, float time, EaseUtils.EaseType ease, TweenUpdateHandler updateCallback = null)
    {
        this.transform.position = start;
        float t = 0f;

        while (t < time)
        {
            float val = t / time;
            float x   = EaseUtils.Ease(ease, start.x, end.x, val);
            float y   = EaseUtils.Ease(ease, start.y, end.y, val);
            float z   = EaseUtils.Ease(ease, start.z, end.z, val);
            this.transform.SetPosition(x, y, z);
            updateCallback?.Invoke(val);
            t += this.LocalDeltaTime;
            yield return(null);
        }
        this.transform.position = end;
        updateCallback?.Invoke(1f);
        yield return(null);
    }
Пример #8
0
    private IEnumerator tweenScale_cr(Vector2 start, Vector2 end, float time, EaseUtils.EaseType ease, TweenUpdateHandler updateCallback = null)
    {
        this.transform.SetScale(start.x, start.y, null);
        float t = 0f;

        while (t < time)
        {
            float val = t / time;
            float x   = EaseUtils.Ease(ease, start.x, end.x, val);
            float y   = EaseUtils.Ease(ease, start.y, end.y, val);
            this.transform.SetScale(x, y, null);
            updateCallback?.Invoke(val);
            t += this.LocalDeltaTime;
            yield return(null);
        }
        this.transform.SetScale(end.x, end.y, null);
        updateCallback?.Invoke(1f);
        yield return(null);
    }
Пример #9
0
    static public IEnumerator TweenValue_cr(float start, float end, float time, EaseUtils.EaseType ease, TweenUpdateHandler updateCallback, TweenCompletedHandler endCallback = null)
    {
        float t = 0f;

        while (t < time)
        {
            float val = t / time;
            updateCallback?.Invoke(EaseUtils.Ease(ease, start, end, val));
            t += CupheadTime.GlobalDelta;
            yield return(null);
        }
        updateCallback?.Invoke(end);
        endCallback?.Invoke();
        yield return(null);
    }
Пример #10
0
    protected IEnumerator tweenValue_cr(float start, float end, float time, EaseUtils.EaseType ease, TweenUpdateHandler updateCallback)
    {
        float t = 0f;

        while (t < time)
        {
            float val = t / time;
            updateCallback?.Invoke(EaseUtils.Ease(ease, start, end, val));
            t += this.LocalDeltaTime;
            yield return(null);
        }
        updateCallback?.Invoke(end);
        yield return(null);
    }