Unity编辑器扩展——撤回

 
 

Undo.IncrementCurrentGroup();

//需要撤回的操作写这里

 GameObject obj = Instantiate(mc.treePrefabs[treeArrayNum], hit.point, Quaternion.identity);

DestroyImmediate(obj, true);
Undo.DestroyObjectImmediate(obj);


Undo.RegisterCreatedObjectUndo(obj, "创建单个物体" + obj.name);

你可能感兴趣的:(unity编辑器扩展,c#,Unity,unity,编辑器,游戏引擎)