khangnhfuky / hotween

Automatically exported from code.google.com/p/hotween
0 stars 0 forks source link

SetValue cause garbage allocation every frame #82

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
protected override void DoUpdate(float p_totElapsed)
{
    float num = this.ease(p_totElapsed, this.typedStartVal, this.changeVal, this._duration, this.tweenObj.easeOvershootOrAmplitude, this.tweenObj.easePeriod);
    if (this.tweenObj.pixelPerfect)
    {
        num = (float)((int)num);
    }

// float to object cause garbage allocation every frame
    this.SetValue(num);
}

Original issue reported on code.google.com by xiongyo...@gmail.com on 16 Sep 2014 at 8:43

Attachments:

GoogleCodeExporter commented 9 years ago
It is in alpha tween, PlugFloat

Original comment by xiongyo...@gmail.com on 16 Sep 2014 at 8:55

GoogleCodeExporter commented 9 years ago
That is the main con of using Reflection, which is used to tween unknown 
objects from a string, and is the only way to do that so there's no other 
solution.

If you're interested I recently released HOTween v2 (DOTween) which doesn't use 
strings anymore nor Reflection and doesn't generate GC allocations (not to 
mention that it's much more performant and efficient in general). It's still in 
alpha but is 95% complete: http://dotween.demigiant.com/

Original comment by daniele....@gmail.com on 16 Sep 2014 at 9:44

GoogleCodeExporter commented 9 years ago
thanks, does the DOTween have PlugVector3Path?

Original comment by xiongyo...@gmail.com on 17 Sep 2014 at 1:47

GoogleCodeExporter commented 9 years ago
Yes and no. It has it and it's almost finished (I have it working here, but I 
want to test it a little more since I added a couple new options), but it will 
be in DOTween Pro, which will require a small one-time fee (here is the reason 
why: http://dotween.demigiant.com/#proExplained)

Original comment by daniele....@gmail.com on 17 Sep 2014 at 3:52