// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
using FlaxEngine;
namespace FlaxEditor.Modules
{
///
/// Base class for all Editor modules.
///
[HideInEditor]
public abstract class EditorModule
{
///
/// Gets the initialization order. Lower first ordering.
///
public int InitOrder { get; protected set; }
///
/// Gets the editor object.
///
public readonly Editor Editor;
///
/// Gets the editor undo.
///
public EditorUndo Undo => Editor.Undo;
///
/// Initializes a new instance of the class.
///
/// The editor.
protected EditorModule(Editor editor)
{
Editor = editor;
}
///
/// Called when Editor is startup up. Performs module initialization.
///
public virtual void OnInit()
{
}
///
/// Called when Editor is ready and will start work.
///
public virtual void OnEndInit()
{
}
///
/// Called when every Editor update tick.
///
public virtual void OnUpdate()
{
}
///
/// Called when Editor is closing. Performs module cleanup.
///
public virtual void OnExit()
{
}
///
/// Called before Editor will enter play mode.
///
public virtual void OnPlayBeginning()
{
}
///
/// Called when Editor is entering play mode.
///
public virtual void OnPlayBegin()
{
}
///
/// Called when Editor leaves the play mode.
///
public virtual void OnPlayEnd()
{
}
}
}