EditorAction
class in
UnityEditor.Actions
Suggest a change
Success!
Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
Close
Submission failed
For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.
Close
Description
Represents an action that spans over multiple frames.
using UnityEngine;
using UnityEditor;
using UnityEditor.Actions;
public class SingleFrameActionSample : EditorAction
{
[MenuItem("Test/Start Single Frame Action")]
static void StartEditorActionSample()
{
Start(new SingleFrameActionSample(4));
}
int m_Value;
public SingleFrameActionSample(int value)
{
m_Value = value;
Finish(EditorActionResult.Success);
}
protected override void OnFinish(EditorActionResult result)
{
m_Value += 2;
Debug.Log($"Action Finished [{result}] with value: {m_Value}");
}
}
Public Methods
Finish | Finishes an EditorAction with a specific result. |
OnSceneGUI | Callback raised when the Scene view calls OnGUI. |
Protected Methods
OnFinish | Callback raised when the EditorAction is finished. |
Static Methods
Start | Starts an EditorAction that spans over multiple frames. |