1
DOTween & DOTween Pro / Re: Tween caching issue
« on: October 09, 2015, 08:14:57 PM »
Ah I see, I think maybe I am approaching this the wrong way then. I'm not very tween-experienced, so forgive me if these are simple questions!
Question 1:
Can you explain how best to setup things in this situation?
Taking a simplified example: I have a red cube.
If I hold down the "Q" key on my keyboard, the cube should color tween from Red to Blue
If I release the "Q" key, the cube should color tween from it's current color back to Red.
If I hold down the "E" key, the cube should color tween from Red to Green.
If I release the "E" key, the cube should color tween from it's current color back to Red.
Do I have to set the starting value for each tween, based on the cube's current color?
Question 2: (semi-related)
Is the problem I'm having due to the fact that I am storing references to Tweens and Sequences, instead of just instantiating a new tween each time?
I'm trying to work out the best/most optimised approached to using DoTween. In general I am using the same tweens on the same UI objects repeatedly in my project, so I thought it best to store a reference to each tween and set AutoKill to false until the game objects are destroyed. Is this the correct approach to using DoTween?
Thanks for you help!
Ben
Question 1:
Can you explain how best to setup things in this situation?
Taking a simplified example: I have a red cube.
If I hold down the "Q" key on my keyboard, the cube should color tween from Red to Blue
If I release the "Q" key, the cube should color tween from it's current color back to Red.
If I hold down the "E" key, the cube should color tween from Red to Green.
If I release the "E" key, the cube should color tween from it's current color back to Red.
Do I have to set the starting value for each tween, based on the cube's current color?
Question 2: (semi-related)
Is the problem I'm having due to the fact that I am storing references to Tweens and Sequences, instead of just instantiating a new tween each time?
I'm trying to work out the best/most optimised approached to using DoTween. In general I am using the same tweens on the same UI objects repeatedly in my project, so I thought it best to store a reference to each tween and set AutoKill to false until the game objects are destroyed. Is this the correct approach to using DoTween?
Thanks for you help!
Ben