0
Answered

Can I access optional parameters?

Ian Marshall 3 years ago updated by Lazlo Bonin (Lead Developer) 3 years ago 4

Hi,

I make use of the LeanTween Library by DentedPixel a lot (http://dentedpixel.com/LeanTweenDocumentation/classes/LeanTween.html) and I am currently in the process of moving my scripts to Bolt.  I have come across a problem...

in my C# scripts I have, for example:

LeanTween.move(gameObject.GetComponent<RectTransform>(), new Vector3(200f,-100f,0f), 1f).setDelay(1f);

and I can invoke this perfectly in Bolt.  However this function has the ability too accept optional parameters  (I use setEase to set the Easing mode for the tween).  From the LeanTween website:

Optional Parameters are passed at the end of every method. Example:LeanTween.moveX( gameObject, 1f, 1f).setEase( LeanTweenType.easeInQuad ).setDelay(1f).


I'm trying to expose this within Bolt and I cant find any way to 'link' the 2.  I can create units for both but cant figure how, or even if, I can connect them?

Any help appreciated

Ian


Bolt Version:
Unity Version:
Platform(s):
Scripting Backend:
.NET Version (API Compatibility Level):
GOOD, I'M SATISFIED
Satisfaction mark by Ian Marshall 3 years ago
Pending Review

Hi Ian! I'm not familiar with Lean Tween, but what happens when you drag out the second output port of, for example, your Move unit here? There could be a top category in the fuzzy finder with these methods available (e.g. set ease, etc.)

By the way, Bolt v.1.4 will include tweening nodes out of the box that will make all of this much more user friendly.

Thanks, once again, Lazio for the quick reply.

I'm away from home at the moment but will try your suggestion as soon as I'm back.

Ian

+1

Hi Lazlo,

No sorry your suggestion did not work.  Thanks anyway.  

Not to worry I have just created my own script and hard-coded the easing parameter in calls to LeanTween within that ;I then pass my vector3 parameters to my code from within Bolt.  Works fine, but its a work-around and not quite as elegant as being able to do everything in Bolt.

I have left a very positive review on the Asset store.  The product and the support could not be better.

cheers

Ian

Answered

Hi Ian, thanks for the kind words!

Usually I would spend more time investigating this issue, but because Bolt v.1.4 will include built-in tweening nodes, I'll refer you to these. 

Cheers!