Version: 2022.3

Undo.undoRedoPerformed

切换到手册
public static Undo.UndoRedoCallback undoRedoPerformed ;

描述

执行撤销或重做后触发的回调。

using UnityEditor;
using UnityEngine;

public class ExampleScript : MonoBehaviour { void Start() { Undo.undoRedoPerformed += MyUndoCallback; }

void MyUndoCallback() { // code for the action to take on Undo } }