Description
The EditLog
method is a virtual method of the GameObject
class in the Sandbox namespace. It is used to log edits made to a GameObject
. However, this method is marked as obsolete and should not be used in new code. Instead, it is recommended to use Scene.Editor.UndoScope
or Scene.Editor.AddUndo
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 the recommended alternatives for better support and future compatibility.
Example
// Example usage of the obsolete EditLog method
// Note: This is for demonstration purposes only and should be avoided in new code.
GameObject myObject = new GameObject();
myObject.EditLog("ChangePosition", new { x = 10, y = 20 });
// Recommended alternative
// using (var undo = Scene.Editor.UndoScope("Change Position"))
// {
// // Perform changes here
// undo.Commit();
// }