Description
The OnEdited
method is a public instance method of the BlockTool
class within the Editor.MeshEditor
namespace. This method is invoked when a serialized property associated with the block tool is edited. It allows for custom handling of property changes, enabling developers to implement specific logic that should occur when a property is modified.
Usage
To use the OnEdited
method, you need to have an instance of the BlockTool
class. This method takes a single parameter of type Sandbox.SerializedProperty
, which represents the property that has been edited. You can implement custom logic within this method to respond to changes in the property.
Example
// Example of using the OnEdited method
public class CustomBlockTool : Editor.MeshEditor.BlockTool
{
public override void OnEdited(Sandbox.SerializedProperty property)
{
// Custom logic to handle the edited property
if (property != null)
{
// Example: Log the property name and value
Log.Info($"Property {property.Name} was edited. New value: {property.Value}");
}
}
}