コード例 #1
0
    private IEnumerator FadeCoroutine(AnimationCurve curve)
    {
        float endTime     = AnimationCurveHelper.LastKey(curve).time;
        float elapsedTime = 0;

        AnimationCurveHelper.ChangeFirstKeyframe(curve, Value);

        while (elapsedTime <= endTime)
        {
            Value = curve.Evaluate(elapsedTime);

            elapsedTime += Time.deltaTime;
            yield return(new WaitForEndOfFrame());
        }

        Value = AnimationCurveHelper.LastKey(curve).value;
    }
コード例 #2
0
ファイル: Fader.cs プロジェクト: 0Arkadias0/LongTermGame5
    private IEnumerator FadeCoroutine(AnimationCurve curve, FadeType type)
    {
        OnTransitionStart(type);
        Transitioning = true;

        AnimationCurveHelper.ChangeFirstKeyframeValue(curve, Value);
        AnimationCurveHelper.ChangeLastKeyframeTime(curve, Duration);

        float endTime     = Duration;
        float elapsedTime = 0;

        while (elapsedTime <= endTime)
        {
            Value = curve.Evaluate(elapsedTime);

            elapsedTime += Time.deltaTime;
            yield return(new WaitForEndOfFrame());
        }

        Value         = AnimationCurveHelper.LastKey(curve).value;
        Transitioning = false;
        OnTransitionStop(type);
    }