IEnumerable<EditorTool> GetSubtools()

robot_2Generated
code_blocksInput

Description

The GetSubtools method is a virtual method of the EditorTool class in the Editor namespace. It is designed to return a collection of sub-tools that the current tool wants to utilize. This method can be overridden in derived classes to provide specific sub-tools relevant to the tool's functionality.

Usage

To use the GetSubtools method, you should call it on an instance of a class that derives from EditorTool. If the method is overridden, it will return a collection of EditorTool instances that represent the sub-tools associated with the tool.

Example usage:

public class MyCustomTool : EditorTool
{
    public override IEnumerable<EditorTool> GetSubtools()
    {
        // Return a list of sub-tools specific to this tool
        return new List<EditorTool>
        {
            new SubTool1(),
            new SubTool2()
        };
    }
}

// Usage
MyCustomTool tool = new MyCustomTool();
IEnumerable<EditorTool> subtools = tool.GetSubtools();

Example

public class MyCustomTool : EditorTool
{
    public override IEnumerable<EditorTool> GetSubtools()
    {
        // Return a list of sub-tools specific to this tool
        return new List<EditorTool>
        {
            new SubTool1(),
            new SubTool2()
        };
    }
}

// Usage
MyCustomTool tool = new MyCustomTool();
IEnumerable<EditorTool> subtools = tool.GetSubtools();