Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use setOnComplete method with parameters #157

Open
ReflexiveFox opened this issue Sep 3, 2020 · 3 comments
Open

How to use setOnComplete method with parameters #157

ReflexiveFox opened this issue Sep 3, 2020 · 3 comments

Comments

@ReflexiveFox
Copy link

ReflexiveFox commented Sep 3, 2020

Maybe it is not the right place to ask a question here, but i hope to get some answers 'cause it seems the best place to ask something about LeanTween.
I saw in many tutorials how to use setOnComplete() without parameters and it works as intended.
What about using setOnComplete() with parameters?
I already tried this code: https://pastebin.com/vA1vDLRF
Any suggestion?
Thanks in advance.

@leandiez
Copy link

Hi, i'm dealing with the same question. Right now cant make work the params to any Action o function

@vedangjavdekar
Copy link

Read through this file from line 1951 onwards, there are a few examples of how to pass parameters to set on complete callback:
https://github.com/dentedpixel/LeanTween/blob/master/Assets/LeanTween/Framework/LTDescr.cs#L1951

@vedangjavdekar
Copy link

@ReflexiveFox I saw your code and I see is your callback has GameObject as argument rather than an object. I would recommend using something like this:

void OnCompleteCallbackWithParam(object InData)
{
    GameObject valueToWorkOn = (GameObject)InData;
    Debug.Log($"In the on complete callback with param: {valueToWorkOn.name}");
    valueToWorkOn.SetActive(false);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants