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.
CloseFor 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.
Closeresult | 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}"); } }