Skip to content

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>("color");
someColorParameter.Value = Color.red;

//Example of setting a component value from a component object
Hackbox.UIComponent someComponent = state["Some component name"];
someComponent.SetParameterValue<Color>("color", Color.blue);

//Example of updating a component parameter
state.SetComponentParameterValue<Color>("Some component name", "color", Color.blue);
Clone this wiki locally