Skip to content

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

@KAW0

Description

@KAW0

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);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions