Comments (6)
Hi!
I preferred to avoid params and/or specific parameter in order to have a cleaner and more usable method signature for callbacks. You can still pass the tween itself via lambda/closures, as long as you assign the callback after assigning the tween.
Cheers!
from dotween.
I'm just worried about the overhead of closures, for example if you add callbacks with element closure in the loop for move a array of elements.
from dotween.
I totally understand your worries, but it's better to have closures than to have to worry about having tweens that are too heavy, since every callback adds around 4B to the tween itself, even if unused. So closures seem to me like the best necessary evil. I'll ponder about this more though: let me know if you have more thoughts.
from dotween.
Closures doesn't work if use OnComplete in a for loop.
from dotween.
Hi @Demigiant, is there any solution to make it gc free without using lambda/closures or params[]?
from dotween.
Ahoy!
If you pass a direct reference to a method without generating an anonymous one via a lambda, GC is avoided there.
myTween.OnComplete(SomeOtherMethod)
from dotween.
Related Issues (20)
- How to make OnUpdate and ChangeEndValue work properly?
- Index out of range error
- Startup errors not giving detailed warnings when default logging enabled
- DOComplete -> TweenManager.FilteredOperation: IndexOutOfRangeException (Possibly related to SetTweensCapacity?)
- [Feature Request] Assembly Definition & Version Define Resource HOT 1
- The DOTweenPath won't rotate or move with the parent
- WaitForCompletion stuck on recycled tween
- Can Dojump use endvalues ββthat change in real time?
- DoPath - Change waypoints during tween is running
- Combining Eases HOT 1
- UI Tweening works unreliably HOT 7
- NaN Input Error HOT 2
- Upgrading to Unity 6 'UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
- SetDelay is appending interval between two tween Joined in sequence HOT 2
- DOTween adds 2.7MB to WebGL build HOT 1
- Is DOJump not supported for Kinematic 3D Rigidbodies?
- Unity using DOTween pro UI creates ghost effect HOT 5
- Does not support the latest 6 preview?
- Demo link is no longer operational
- bug: real-time animations take more time than expected
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dotween.