Description
The TypeName
property of the SerializedObject
class provides the name of the type that the serialized object represents. This property is useful for identifying the type of the serialized data, especially when dealing with multiple types of serialized objects.
Usage
To access the TypeName
property, you need to have an instance of a class that inherits from SerializedObject
. You can then retrieve the type name as a string.
Example
// Assuming 'mySerializedObject' is an instance of a class derived from SerializedObject
string typeName = mySerializedObject.TypeName;
// Output the type name
// Note: Avoid using Console.WriteLine in Sandbox
// Instead, use a UI element or logging system to display the type name
Log.Info($"The type name of the serialized object is: {typeName}");