docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class TilemapEditorTool

    A base class for Editor Tools which work with the Tile Palette and GridBrushes

    Inheritance
    object
    Object
    ScriptableObject
    EditorTool
    TilemapEditorTool
    BoxTool
    EraseTool
    FillTool
    FlipTool
    MoveTool
    PaintTool
    PickingTool
    RotateTool
    SelectTool
    Inherited Members
    EditorTool.OnWillBeDeactivated()
    EditorTool.OnToolGUI(EditorWindow)
    EditorTool.PopulateMenu(DropdownMenu)
    EditorTool.SetHidden(bool)
    EditorTool.targets
    EditorTool.target
    EditorTool.toolbarIcon
    EditorTool.gridSnapEnabled
    EditorTool.isHidden
    ScriptableObject.SetDirty()
    ScriptableObject.CreateInstance(string)
    ScriptableObject.CreateInstance(Type)
    ScriptableObject.CreateInstance<T>()
    Object.GetEntityId()
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(object)
    Object.InstantiateAsync<T>(T)
    Object.InstantiateAsync<T>(T, Transform)
    Object.InstantiateAsync<T>(T, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int)
    Object.InstantiateAsync<T>(T, int, Transform)
    Object.InstantiateAsync<T>(T, int, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>)
    Object.InstantiateAsync<T>(T, int, Transform, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int, Transform, Vector3, Quaternion, CancellationToken)
    Object.InstantiateAsync<T>(T, int, Transform, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>)
    Object.InstantiateAsync<T>(T, int, Transform, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>, CancellationToken)
    Object.InstantiateAsync<T>(T, InstantiateParameters, CancellationToken)
    Object.InstantiateAsync<T>(T, int, InstantiateParameters, CancellationToken)
    Object.InstantiateAsync<T>(T, Vector3, Quaternion, InstantiateParameters, CancellationToken)
    Object.InstantiateAsync<T>(T, int, Vector3, Quaternion, InstantiateParameters, CancellationToken)
    Object.InstantiateAsync<T>(T, int, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>, InstantiateParameters, CancellationToken)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Scene)
    Object.Instantiate<T>(T, InstantiateParameters)
    Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, bool)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, bool)
    Object.Destroy(Object, float)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, bool)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.FindObjectsOfType(Type, bool)
    Object.FindObjectsByType(Type, FindObjectsSortMode)
    Object.FindObjectsByType(Type, FindObjectsInactive, FindObjectsSortMode)
    Object.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, float)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    Object.FindObjectsByType<T>(FindObjectsSortMode)
    Object.FindObjectsOfType<T>(bool)
    Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
    Object.FindObjectOfType<T>()
    Object.FindObjectOfType<T>(bool)
    Object.FindFirstObjectByType<T>()
    Object.FindAnyObjectByType<T>()
    Object.FindFirstObjectByType<T>(FindObjectsInactive)
    Object.FindAnyObjectByType<T>(FindObjectsInactive)
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.FindFirstObjectByType(Type)
    Object.FindAnyObjectByType(Type)
    Object.FindObjectOfType(Type, bool)
    Object.FindFirstObjectByType(Type, FindObjectsInactive)
    Object.FindAnyObjectByType(Type, FindObjectsInactive)
    Object.ToString()
    Object.name
    Object.hideFlags
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: UnityEditor.Tilemaps
    Assembly: Unity.2D.Tilemap.Editor.dll
    Syntax
    public abstract class TilemapEditorTool : EditorTool

    Properties

    shortcutId

    Shortcut Id for this tool

    Declaration
    protected abstract string shortcutId { get; }
    Property Value
    Type Description
    string

    tilemapEditorTools

    All currently active Editor Tools which work with the Tile Palette

    Declaration
    public static EditorTool[] tilemapEditorTools { get; }
    Property Value
    Type Description
    EditorTool[]

    tilemapEditorToolsToolbarSize

    The horizontal size of a Toolbar with all the TilemapEditorTools

    Declaration
    [Obsolete]
    public static float tilemapEditorToolsToolbarSize { get; }
    Property Value
    Type Description
    float

    tooltipStringFormat

    Tooltip String format which accepts a shortcut combination as the parameter

    Declaration
    protected abstract string tooltipStringFormat { get; }
    Property Value
    Type Description
    string

    Methods

    GetKeysFromToolName(string)

    Gets the key combination for triggering the shortcut for this tool

    Declaration
    protected static string GetKeysFromToolName(string id)
    Parameters
    Type Name Description
    string id

    The shortcut id for this tool

    Returns
    Type Description
    string

    The key combination for triggering the shortcut for this tool

    GetTooltipText(string, string)

    Gets the text for the tooltip given a tooltip string format and the shortcut combination for a tooltip

    Declaration
    protected static string GetTooltipText(string tooltipStringFormat, string shortcutId)
    Parameters
    Type Name Description
    string tooltipStringFormat

    String format which accepts a shortcut combination as the parameter

    string shortcutId

    Shortcut Id for this tool

    Returns
    Type Description
    string

    The final text for the tooltip

    HandleTool(bool, GridLayout, GameObject, Vector3Int)

    Method called when the Tool is being used. Override this to have custom behaviour when the Tool is used.

    Declaration
    public virtual bool HandleTool(bool isHotControl, GridLayout gridLayout, GameObject brushTarget, Vector3Int gridMousePosition)
    Parameters
    Type Name Description
    bool isHotControl

    Whether the tool is the hot control

    GridLayout gridLayout

    GridLayout the tool is being used on

    GameObject brushTarget

    Target GameObject the tool is being used on

    Vector3Int gridMousePosition

    Grid Cell position of the Mouse on the GridLayout

    Returns
    Type Description
    bool

    Whether the tool has been used and modified the brushTarget

    IsAvailable()

    Gets whether the tool is available for use

    Declaration
    public override bool IsAvailable()
    Returns
    Type Description
    bool

    Whether the tool is available for use

    Overrides
    EditorTool.IsAvailable()

    OnActivated()

    Callback when a TilemapEditorTool is activated

    Declaration
    public override void OnActivated()
    Overrides
    EditorTool.OnActivated()

    SetActiveEditorTool(Type)

    Sets the current active editor tool to the type passed in

    Declaration
    public static void SetActiveEditorTool(Type type)
    Parameters
    Type Name Description
    Type type

    The type of editor tool. This must be inherited from TilemapEditorTool

    Exceptions
    Type Condition
    ArgumentException

    Throws this if an invalid type parameter is set

    ToggleActiveEditorTool(Type)

    Toggles the state of active editor tool with the type passed in.

    Declaration
    public static void ToggleActiveEditorTool(Type type)
    Parameters
    Type Name Description
    Type type

    The type of editor tool. This must be inherited from EditorTool.

    Remarks

    This will change the current active editor tool if the type passed in is not the same as the current active editor tool. Otherwise, it will set the View Mode tool as the current active editor tool.

    UpdateTooltip()

    Updates the tooltip whenever there is a change in shortcut combinations

    Declaration
    protected void UpdateTooltip()
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)