docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class GridPaintingState

    GridPaintingState controls the state of objects for painting with a Tile Palette.

    Inheritance
    object
    Object
    ScriptableObject
    ScriptableSingleton<GridPaintingState>
    GridPaintingState
    Inherited Members
    ScriptableSingleton<GridPaintingState>.Save(bool)
    ScriptableSingleton<GridPaintingState>.GetFilePath()
    ScriptableSingleton<GridPaintingState>.instance
    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 class GridPaintingState : ScriptableSingleton<GridPaintingState>
    Remarks

    Utilize this class to get and set the current painting target and brush for painting with the Tile Palette.

    Properties

    activeBrushEditor

    The currently active editor for the active brush for the Tile Palette

    Declaration
    public static GridBrushEditorBase activeBrushEditor { get; }
    Property Value
    Type Description
    GridBrushEditorBase

    brushPickStore

    Returns a store of brush selection data for the current gridBrush

    Declaration
    public static GridBrushPickStore brushPickStore { get; }
    Property Value
    Type Description
    GridBrushPickStore

    brushes

    Returns all available brushes for the Tile Palette

    Declaration
    public static IList<GridBrushBase> brushes { get; }
    Property Value
    Type Description
    IList<GridBrushBase>

    gridBrush

    The currently active brush for the Tile Palette

    Declaration
    public static GridBrushBase gridBrush { get; set; }
    Property Value
    Type Description
    GridBrushBase

    isEditing

    Returns whether GridPaintingState is active for editing.

    Declaration
    public static bool isEditing { get; }
    Property Value
    Type Description
    bool

    isPaletteEditable

    Whether the active palette can be edited.

    Declaration
    public static bool isPaletteEditable { get; }
    Property Value
    Type Description
    bool

    lastSceneViewGridPosition

    The last active grid position on the SceneView when the GridPaintingState is active.

    Declaration
    public static Vector3Int lastSceneViewGridPosition { get; }
    Property Value
    Type Description
    Vector3Int

    lastSceneViewMousePosition

    The last active mouse position on the SceneView when the GridPaintingState is active.

    Declaration
    public static Vector2 lastSceneViewMousePosition { get; }
    Property Value
    Type Description
    Vector2

    palette

    The currently active palette GameObject for the Tile Palette

    Declaration
    public static GameObject palette { get; set; }
    Property Value
    Type Description
    GameObject

    palettes

    Returns all available Palette GameObjects for the Tile Palette

    Declaration
    public static IList<GameObject> palettes { get; }
    Property Value
    Type Description
    IList<GameObject>

    scenePaintTarget

    The currently active target for the Tile Palette

    Declaration
    public static GameObject scenePaintTarget { get; set; }
    Property Value
    Type Description
    GameObject

    validTargets

    A list of all valid targets that can be set as an active target for the Tile Palette

    Declaration
    public static GameObject[] validTargets { get; }
    Property Value
    Type Description
    GameObject[]

    Methods

    IsPartOfActivePalette(GameObject)

    Checks if target GameObject is part of the active Palette.

    Declaration
    public static bool IsPartOfActivePalette(GameObject target)
    Parameters
    Type Name Description
    GameObject target

    GameObject to check.

    Returns
    Type Description
    bool

    True if the target GameObject is part of the active palette. False if not.

    SetPickOnActiveGridBrush(bool, int)

    Retrieves a stored selection from the current Active GridBrushPickStore and copies it into the Active GridBrush.

    Declaration
    public static void SetPickOnActiveGridBrush(bool user, int index)
    Parameters
    Type Name Description
    bool user

    Use user selection or last selection.

    int index

    Index of selection from store to use.

    Events

    beforePaletteChanged

    Callback before the Tile Palette's active palette GameObject has changed.

    Declaration
    public static event Action beforePaletteChanged
    Event Type
    Type Description
    Action

    brushChanged

    Callback when the Tile Palette's active brush has changed.

    Declaration
    public static event Action<GridBrushBase> brushChanged
    Event Type
    Type Description
    Action<GridBrushBase>

    brushPickChanged

    Callback when the Tile Palette's active brush's selection has changed.

    Declaration
    public static event Action brushPickChanged
    Event Type
    Type Description
    Action

    brushPickStoreChanged

    Callback when the Tile Palette's brush selection store has changed.

    Declaration
    public static event Action brushPickStoreChanged
    Event Type
    Type Description
    Action

    brushToolsChanged

    Callback when the Tile Palette's active brush tools have changed.

    Declaration
    public static event Action brushToolsChanged
    Event Type
    Type Description
    Action

    editModeChanged

    Callback when Tile Palette edit mode has changed.

    Declaration
    public static event Action editModeChanged
    Event Type
    Type Description
    Action

    paletteChanged

    Callback when the Tile Palette's active palette GameObject has changed.

    Declaration
    public static event Action<GameObject> paletteChanged
    Event Type
    Type Description
    Action<GameObject>

    palettesChanged

    Callback when the Tile Palette's list of palettes has changed

    Declaration
    public static event Action palettesChanged
    Event Type
    Type Description
    Action

    scenePaintTargetChanged

    Callback when the Tile Palette's active target has changed

    Declaration
    public static event Action<GameObject> scenePaintTargetChanged
    Event Type
    Type Description
    Action<GameObject>

    scenePaintTargetEdited

    Callback when the Tile Palette's active target has been edited

    Declaration
    public static event Action<GameObject> scenePaintTargetEdited
    Event Type
    Type Description
    Action<GameObject>

    validTargetsChanged

    Callback when the Tile Palette's valid targets has changed.

    Declaration
    public static event Action validTargetsChanged
    Event Type
    Type Description
    Action
    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)