GetComponent

public Component GetComponent(Component defaultValue) ;

Get the value of the Component type.

Parameter Name Description
defaultValue Default value. It is returned when there is no parameter.

The value of the parameter. If there is no parameter, it returns defaultValue.

public TComponent GetComponent<TComponent>(TComponent defaultValue) ;

Get the value of the Component type.

Type Parameter Name Description Type Constraints
TComponent Type of Component to get
Parameter Name Description
defaultValue Default value. It is returned when there is no parameter.

The value of the parameter. If there is no parameter, it returns defaultValue.