void OnEnabled()

book_4_sparkGenerated
code_blocksInput

Description

The OnEnabled method is a virtual method in the Editor.EditorTool class. It is called when the editor tool is enabled, allowing you to perform any initialization or setup required when the tool becomes active.

Usage

Override the OnEnabled method in a derived class to implement custom behavior that should occur when the tool is enabled. This could include setting up event listeners, initializing variables, or preparing the tool's UI.

Example

public class MyCustomTool : Editor.EditorTool
{
    public override void OnEnabled()
    {
        // Custom initialization code here
        // For example, setting up UI elements or event listeners
    }
}