System.Type GetParameterType( int index )
System.Type GetParameterType( string name )

book_4_sparkGenerated
code_blocksInput

Description

The GetParameterType method of the AnimationGraph class retrieves the type of a parameter at a specified index within the animation graph. This method is useful for understanding the data type of parameters used in the animation graph, which can be essential for debugging or dynamically interacting with the graph's parameters.

Usage

To use the GetParameterType method, you need to have an instance of the AnimationGraph class. You can then call this method by passing the index of the parameter whose type you want to retrieve. Ensure that the index is within the valid range, i.e., between 0 and ParamCount - 1.

Example

// Assume 'animationGraph' is an instance of AnimationGraph
int parameterIndex = 0;
System.Type parameterType = animationGraph.GetParameterType(parameterIndex);

// Output the type of the parameter
if (parameterType != null)
{
    // Use the parameter type as needed
    // For example, check if it's a float
    if (parameterType == typeof(float))
    {
        // Handle float parameter
    }
}