Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - PaulUsul

Pages: [1]
1
Getting an exception and thought I'd register and post it.
Unity Version 4.6.3 can't find the DoTween version :/

Code: [Select]
I/Unity   (19068): IndexOutOfRangeException: Array index is out of range.
I/Unity   (19068):   at (wrapper stelemref) object:stelemref (object,intptr,object)
I/Unity   (19068):   at DG.Tweening.Core.TweenManager.AddActiveTween (DG.Tweening.Tween t) [0x00000] in <filename unknown>:0
I/Unity   (19068):   at DG.Tweening.Core.TweenManager.GetTweener[Single,Single,FloatOptions] () [0x00000] in <filename unknown>:0
I/Unity   (19068):   at DG.Tweening.DOTween.ApplyTo[Single,Single,FloatOptions] (DG.Tweening.Core.DOGetter`1 getter, DG.Tweening.Core.DOSetter`1 setter, Single endValue, Single duration, DG.Tweening.Plugins.Core.ABSTweenPlugin`3 plugin) [0x00000] in <filename unknown>:0
I/Unity   (19068):   at DG.Tweening.DOTween.To (DG.Tweening.Core.DOGetter`1 getter, DG.Tweening.Core.DOSetter`1 setter, Single endValue, Single duration) [0x00000] in <filename unknown>:0
I/Unity   (19068):   at DG.Tweening.DOTween.To (DG.Tweening.Core.DOSetter`1 setter, Single startValue, Single endValue, Single duration) [0x00000] in <filename unknown>:0
I/Unity   (19068):   at Loadingbar.SetProgress (Single levelLoadProgress, System.String text, System.String headlineText, Boole

Code calling it looks like this
Code: [Select]
        if(tweener != null && tweener.IsActive()) {
            tweener.ChangeEndValue(progress, true);
        }
        else {
            DOSetter<float> doSetter = value => {
                float f = Mathf.Min(value - slider.value, 0.01f);
                //Debug.Log(Time.frameCount + " " + Time.realtimeSinceStartup + " doSetter " + value + " : " + (slider.value + f) + " " + f);
                if(slider.value + f <= value) {
                    slider.value += f;
                    //slider.value = value;
                }
            };
            tweener = DOTween.To(doSetter, slider.value, progress, 0.25f);
            tweener.SetSpeedBased(true);
            tweener.SetUpdate(true);
            tweener.SetEase(Ease.Linear);
        }

Pages: [1]