文档

Unity Engine

Unity Engine

undoRedoEvent

Callback that is triggered after any undo or redo event.
阅读时间1 分钟最后更新于 1 个月前

Definition

  • Type: Field
  • Namespace: UnityEditor
  • Assembly: UnityEditor.CoreModule
public static Undo.UndoRedoEventCallback undoRedoEvent

Examples

using UnityEditor;using UnityEngine;public class ExampleUndoRedoEventScript : MonoBehaviour{ void Start() { Undo.undoRedoEvent += OnUndoRedoEvent; } void OnDestroy() { Undo.undoRedoEvent -= OnUndoRedoEvent; } void OnUndoRedoEvent(in UndoRedoInfo info) { // code for the action to take on Undo or Redo event }}