Description
The OnDestroyed
method is a virtual method in the Editor.QObject
class. It is intended to be overridden in derived classes to provide custom behavior when the object is destroyed. This method is called automatically when the object is being destroyed, allowing for cleanup or other necessary operations to be performed.
Usage
To use the OnDestroyed
method, you should create a subclass of Editor.QObject
and override the OnDestroyed
method. Within your override, implement any logic that should occur when the object is destroyed. This could include releasing resources, notifying other components, or logging information.
Example
public class CustomQObject : Editor.QObject
{
protected override void OnDestroyed()
{
// Custom cleanup logic here
// For example, logging or releasing resources
Log.Info("CustomQObject has been destroyed.");
}
}