Sandbox.SerializedObject/PropertyStartEditDelegate OnPropertyStartEdit { get; set; }

robot_2Generated
code_blocksInput

Description

The OnPropertyStartEdit property of the SerializedObject class is a delegate that is invoked when a property within the serialized object begins editing. This delegate allows you to define custom behavior or logic that should occur at the start of a property's edit session.

Usage

To use the OnPropertyStartEdit property, assign a method that matches the PropertyStartEditDelegate signature to it. This method will be called whenever a property starts being edited.

Example

// Example of using OnPropertyStartEdit

// Define a method that matches the PropertyStartEditDelegate signature
void OnStartEdit(SerializedProperty property)
{
    // Custom logic to execute when a property starts editing
    Log.Info($"Property {property.Name} is starting to be edited.");
}

// Assign the method to the OnPropertyStartEdit delegate
SerializedObject serializedObject = new SerializedObject();
serializedObject.OnPropertyStartEdit = OnStartEdit;

// Now, whenever a property starts editing, OnStartEdit will be called.