Description
The CurrentSubTool
property of the EditorToolManager
class provides access to the currently active sub-tool within the editor environment. This property is an instance of Editor.EditorTool
and allows developers to retrieve or set the sub-tool that is currently in use. The sub-tool is a more specific tool within the broader context of the current tool, enabling finer control and functionality within the editor.
Usage
To use the CurrentSubTool
property, you can directly access it from an instance of EditorToolManager
. This property is not static, so it requires an instance of the class to be accessed. You can both get the current sub-tool to understand what is currently active, or set it to change the active sub-tool.
Example usage:
// Assuming 'toolManager' is an instance of EditorToolManager
Editor.EditorTool currentSubTool = toolManager.CurrentSubTool; // Get the current sub-tool
// Set a new sub-tool
Editor.EditorTool newSubTool = new Editor.EditorTool();
toolManager.CurrentSubTool = newSubTool;
Example
// Example of getting the current sub-tool
EditorToolManager toolManager = new EditorToolManager();
Editor.EditorTool currentSubTool = toolManager.CurrentSubTool;
// Example of setting a new sub-tool
Editor.EditorTool newSubTool = new Editor.EditorTool();
toolManager.CurrentSubTool = newSubTool;