Description
The EditLog
method is a virtual method of the GameObject
class in the Sandbox framework. It is used to log edits made to a game object. However, this method is marked as obsolete, and it is recommended to use Scene.Editor.UndoScope
or Scene.Editor.AddUndo
instead for managing undo operations in the editor.
Usage
To use the EditLog
method, you need to provide a string
representing the name of the edit and an object
representing the source of the edit. However, since this method is obsolete, it is advised to transition to using the recommended alternatives for better support and future compatibility.
Example
// Example of using EditLog (not recommended due to obsolescence)
GameObject myObject = new GameObject();
myObject.EditLog("Change Position", new { x = 10, y = 20 });
// Recommended approach
using (var undo = Scene.Editor.UndoScope("Change Position"))
{
// Perform changes here
// undo.AddUndoStep(...);
}