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 - flashframe

Pages: [1]
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


2
DOTween & DOTween Pro / Re: Tween caching issue
« on: October 09, 2015, 07:42:45 PM »
Hi Daniele,

Is it possible to do this directly through scripting? I have a similar problem where a color & scale sequence is seemingly holding onto a cached starting value, instead of tweeting from the current value.

Here's more specific information of my problem (hopefully understandable!)
I have three sequences on two button objects:

Focus
Defocus
Normal

OnKeyDown.KeyCode.Q = Button1 plays its Focus sequence and Button2 plays it's Defocus sequence.
OnKeyDown.KeyCode.E = The opposite happens.
OnKeyUp.KeycodeQ || E =  All sequences are paused. Both buttons play their Normal sequence.

The problem: I want the normal sequence to tween from the current value. It seems that the Normal sequence holds onto it's original starting value the first time it is played.

Am I missing something? Can you help?

Thanks!

Ben

Pages: [1]