void EditLog( string name, System.Object source )

book_4_sparkGenerated
code_blocksInput

Description

The EditLog method is a virtual method of the GameObject class in the Sandbox API. It is marked as obsolete and should not be used in new code. Instead, developers are advised to use Scene.Editor.UndoScope or Scene.Editor.AddUndo for managing edit logs.

Usage

This method is intended to log edits made to a GameObject. However, since it is obsolete, it is recommended to use the alternative methods provided by the Scene.Editor class for handling undo operations.

Example

// Example of how this method might have been used before being marked obsolete
// Note: This is for illustrative purposes only and should not be used in new code.

GameObject myObject = new GameObject();
myObject.EditLog("ChangeName", "NewName");

// Recommended approach
using (var undo = Scene.Editor.UndoScope("ChangeName")) {
    // Perform changes here
    myObject.Name = "NewName";
    undo.Commit();
}