Beispiel #1
0
        public void UpdateValue(float clampedValue)
        {
            if (!IsPlaying)
            {
                return;
            }

            CurDuration += TweenInfo.IgnoreTimeScale ? Time.unscaledDeltaTime : Time.deltaTime;
            if (CurDuration > TweenInfo.Duration)
            {
                CurDuration = TweenInfo.Duration;
            }

            float diff  = TweenInfo.To - TweenInfo.From;
            float delta = diff * clampedValue;

            Value = TweenInfo.From + delta;

            if (TweenInfo.Callback == null)
            {
                Debug.LogWarning("Callback did not set");
            }
            else
            {
                TweenInfo.Callback(Value, clampedValue == 1);
            }
        }