The CurrentModeName
property of the EditorToolManager
class holds the name of the current tool being used in the editor. This property is stored as a string, making it easy to store and restore the tool's state. It provides a single point of access to change or read the current tool's name. Note that the tool will not change until the next frame update, ensuring consistency during the current frame's operations.
To access the current tool's name, simply use the CurrentModeName
property. This is a static property, so it can be accessed directly from the EditorToolManager
class without needing an instance.
Example usage:
string currentToolName = EditorToolManager.CurrentModeName;
To change the current tool, use the SetTool
method of the EditorToolManager
class, passing the desired tool name as a parameter. The CurrentModeName
will be updated in the next frame.
EditorToolManager.SetTool("NewToolName");