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

Pages: [1]
1
DOTween & DOTween Pro / Re: Tween caching issue
« on: August 11, 2015, 03:50:28 PM »
Hi, and sorry for the late reply (the notification system broke),


To use visual tweens with a polling system, add a manager to your gameObject (by using the "Add Manager" button on one of the DOTweenAnimations attached to it), and select the "Pooling System" preset. That will un-cache the starting position each time your gameObject comes back from a disabled state.

Thank you very much, Daniele. That did the trick.

2
DOTween & DOTween Pro / Tween caching issue
« on: July 21, 2015, 02:04:58 PM »
Hello,

I am using DoTweenPro and I am trying to implement a floating score feature that shows above the enemies whenever you hit them. I have added a tweenComponent to a FloatingScore gameObject that moves the score text relative to the position of the object it is shown above. However if I add the FloatingScore gameObject to an object pool, for some reason the DoTween system caches the start position of the first object to which it is shown above. Whenever I get an already used FloatingScore object from the pool, although I change its transform, the tween is moved relative to the previous position of the object. I have gone through the DoTween documentation and read that the DoTweenPro system is actually caching the tweens for optimization purposes and I am pretty sure that this is causing my issue. Is there a way to disable the cache or to reset the tween values?

I have workaround the issue by removing the DOTweenAnimation component from the game object and simply using DOMove on the transform once I get the game object from the pool, but I am not sure that this is the best way to implement.

obj.GetComponent<RectTransform> ().transform.DOMove (alteredPosition, 0.5f).OnComplete(() => obj.SetActive(false));

Thanks

3
Thank you, cynicalwanderer, that solved my issue.

4
Hi,

Already posted on the unity forums, but anyways.. I am using the DoTween Pro version. I want to have a panel that slides out from the left side of the window and after a couple of seconds slides back in using a different move algorithm. I have added two DoTweenAnimation scripts to the game object, set them up and named them with different ids - NotificationOut and NotificationIn. In my show function I first rewind and than play both tweens.

Quote
panel.gameObject.GetComponent<DOTweenAnimation> ().DORewind ();
panel.gameObject.GetComponent<DOTweenAnimation> ().DOPlayById ("NotificationOut"); 
 
yield return new WaitForSeconds(2.5f);
 
panel.gameObject.GetComponent<DOTweenAnimation> ().DOPlayById ("NotificationIn");

My questions are:
1. Is this the correct way to use the component when having multiple tweens attached to the same game object.
2. How can I subscribe for the onCompleted event of the second tween - NotificationIn.

Thanks in advance

Pages: [1]