result | The state that the EditorAction was finished in. |
Finishes an EditorAction with a specific result.
Call this method to forcibly end an active EditorAction with a EditorActionResult. A common use is when implementing atomic actions that do not require interactivity.
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}"); } }