Description
The OnDestroyed
method is a virtual method in the Editor.ComponentSheetHeader
class. It is intended to be called when the component sheet header is destroyed. This method can be overridden in derived classes to provide custom cleanup logic or to release resources that the component sheet header may be holding.
Usage
To use the OnDestroyed
method, you can override it in a subclass of Editor.ComponentSheetHeader
. This allows you to implement custom behavior that should occur when the component sheet header is destroyed. Ensure that any resources or references held by the component are properly released to prevent memory leaks.
Example
public class CustomComponentSheetHeader : Editor.ComponentSheetHeader
{
public override void OnDestroyed()
{
// Custom cleanup logic here
// For example, releasing resources or unsubscribing from events
base.OnDestroyed(); // Call the base class method if necessary
}
}