The Invoke
method in the SerializedProperty
class is used to execute a method represented by the serialized property. This method is virtual, allowing derived classes to provide their own implementation if necessary.
The Invoke
method in the SerializedProperty
class is used to execute a method represented by the serialized property. This method is virtual, allowing derived classes to provide their own implementation if necessary.
To use the Invoke
method, ensure that the SerializedProperty
instance represents a method. You can check this by using the IsMethod
property. If the property is indeed a method, calling Invoke
will execute it.
// Example usage of SerializedProperty.Invoke SerializedProperty property = ...; // Assume this is initialized and represents a method if (property.IsMethod) { property.Invoke(); }