-
Notifications
You must be signed in to change notification settings - Fork 2
Editing States from Code
Ashley edited this page Jul 28, 2022
·
8 revisions
//TODO
//Example of getting a component from a state
Hackbox.UIComponent someComponent = state["Some component name"];
/* OR */
Hackbox.UIComponent someComponent = state.GetComponent("Some component name");
//Example of getting a component value from a component object and updating the value of it
ColorParameter someColorParameter = someComponent.GetParameter<ColorParameter>("textColor");
someColorParameter.Value = Color.red;
//Example of setting a component value from a component object
Hackbox.UIComponent someComponent = state["Some component name"];
someComponent.SetParameterValue<Color>("textColor", Color.blue);
//Example of updating a component parameter
state.SetComponentParameterValue<Color>("Some component name", "textColor", Color.blue);