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

Change Toggle(Action clickEvent) to Toggle(Action<bool> clickEvent) #20

Open
KAW0 opened this issue Jun 8, 2018 · 0 comments
Open

Change Toggle(Action clickEvent) to Toggle(Action<bool> clickEvent) #20

KAW0 opened this issue Jun 8, 2018 · 0 comments

Comments

@KAW0
Copy link

KAW0 commented Jun 8, 2018

Change UnityEngine.Experimental.UIElements.Toggle(Action clickEvent) to UnityEngine.Experimental.UIElements.Toggle(Action<bool> clickEvent).
It will simplify design.
This:

void OnEnable()
{
	var root = this.GetRootVisualContainer();
        toggle = new UnityEngine.Experimental.UIElements.Toggle(x=> Debug.Log(x));
	root.Add(toggle);
}

instead of this:

void OnEnable()
{
	var root = this.GetRootVisualContainer();
        toggle = new UnityEngine.Experimental.UIElements.Toggle(Test);
	root.Add(toggle);
}
Toggle toogle;
void Test()
{
       Debug.Log(toogle.on);
}
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

1 participant