Demigiant Forum
Unity Assets => DOTween & DOTween Pro => Topic started by: spacexplorer on July 20, 2015, 08:52:47 AM
-
multiple properties in one declaration
At the moment I m doing this
-------------------------------------------------------------------------------
//if (Input.GetKey (KeyCode.LeftArrow)
currentScreenTransform.DOLocalMove(screenShowPosition,1);
currentScreenTransform.DORotate(screenShowRotation,1);
-------------------------------------------------------------------------------
Is it possible to do it in one line of code/declaration
Also: I would like to do a from and to in one declaration rather then first setting the start position and then the DOLocalMove
It seems I can only do either a From or a To
-----------------------------------------
currentScreenTransform.DOLocalMove(screenStartPosition,0); //0 seconds - jump to start position
currentScreenTransform.DOLocalMove(screenShowPosition,1);
currentScreenTransform.DORotate(screenStartRotation,0);
currentScreenTransform.DORotate(screenShowRotation,1);
---------------------------------------
-
To play more than one action at once you would need to use a sequence: http://dotween.demigiant.com/documentation.php#creatingSequence
-----------------------------------------------------------------
sequence mySequence = DOTween.Sequence();
mySequence.insert(0,currentScreenTransform.DOLocalMove(screenShowPosition,1));
mySequence.insert(0,currentScreenTransform.DORotate(screenShowRotation,1));
mySequence.Play();
-------------------------------------------------------------------
the 0 in insert is the position in the sequence you would like to place things ex:
-------------------------------------------------------------------------------------------------------
sequence mySequence = DOTween.Sequence();
mySequence.insert(0,currentScreenTransform.DOLocalMove(screenShowPosition,1));
mySequence.insert(0,currentScreenTransform.DORotate(screenShowRotation,1));
mySequence.insert(1,currentScreenTransform.DOPath(somepath,0.5f);
mySequence.Play();
--------------------------------------------------------------------------------------------------
would do the first 2 tweens, then when they complete it would play the 3rd.
hope this helps!