Description
The EditLog
method is a virtual method of the GameObject
class in the Sandbox namespace. This method is marked as obsolete and should not be used in new code. It was originally intended to log edits made to a GameObject
for tracking changes. However, it is now recommended to use Scene.Editor.UndoScope
or Scene.Editor.AddUndo
for managing undo operations in the editor.
Usage
Since EditLog
is obsolete, you should avoid using it in your code. Instead, use the recommended alternatives for managing undo operations:
Scene.Editor.UndoScope
: Use this to create a scope for undo operations, allowing you to group multiple changes into a single undoable action.
Scene.Editor.AddUndo
: Use this to add individual undoable actions to the editor's undo stack.
Example
// Example of using the recommended alternatives instead of EditLog
// Using Scene.Editor.UndoScope
using (var undoScope = new Scene.Editor.UndoScope("Change GameObject Name"))
{
gameObject.Name = "NewName";
// Other changes can be added here
}
// Using Scene.Editor.AddUndo
Scene.Editor.AddUndo(() => gameObject.Name = "OldName", "Change GameObject Name");
gameObject.Name = "NewName";