DeveloperConsole.GetField C# (CSharp) Method

GetField() public method

public GetField ( GameObject gameObject, Component component, string fieldName ) : void
gameObject GameObject
component Component
fieldName string
return void
	void GetField ( GameObject gameObject, Component component, string fieldName )
	{
		Type componentType = component.GetType();
		FieldInfo fInfo = componentType.GetField( fieldName );
		
		if ( fInfo != null )
		{
			PrintToConsole( fInfo.GetValue( component ).ToString() );
		}
	}