Kanzi 3.9.10
StateObject Interface Reference

Configure state objects in a state. More...

Inheritance diagram for StateObject:
[legend]
Collaboration diagram for StateObject:
[legend]

Properties

State State [get]
 Gets the state of the selected state object.
 
string TargetObjectPath [get, set]
 Gets or sets the path to the node to which Kanzi applies the state of the selected state object.
 

Detailed Description

Configure state objects in a state.

State objects define the properties of nodes for a specific state. For example, you can assign a state manager to a Button 3D node which contains a Model node that defines the look of the button. State object sets the properties in the Model node using Target Object Path (Model).

See also
State, StateGroup, StateTransition, ProjectItem, Project.StateManagerLibrary

Property Documentation

◆ State

State State
get

Gets the state of the selected state object.

The state of this state object.

◆ TargetObjectPath

string TargetObjectPath
getset

Gets or sets the path to the node to which Kanzi applies the state of the selected state object.

The path to the node.

Examples

To set the path of the node to which Kanzi applies the state:

{
// Get the State Managers library which stores state managers used in a Kanzi Studio project.
var stateManagerLibrary = studio.ActiveProject.StateManagerLibrary;
// Create a state manager named MyStateManager in the State Managers library.
var myStateManager = studio.ActiveProject.CreateProjectItem<StateManager>(
stateManagerLibrary.GenerateUniqueChildName("MyStateManager"), stateManagerLibrary);
// Create a state group named MyStateGroup in the MyStateManager state manager.
var myStateGroup = studio.ActiveProject.CreateProjectItem<StateGroup>(
myStateManager.GenerateUniqueChildName("MyStateGroup"),
// Create a state named MyState in the MyStateGroup state group.
var myState = studio.ActiveProject.CreateProjectItem<State>(
myStateGroup.GenerateUniqueChildName("MyState"),
// Create a state object named MyStateObject in MyState state.
var myStateObject = studio.ActiveProject.CreateProjectItem<StateObject>(
myState.GenerateUniqueChildName("MyStateObject"),
// Apply the MyState state to the Image node inside the Contacts node.
myStateObject.TargetObjectPath = "./Contacts/Image";
}