docs.unity.cn
    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
    UnityEditor.ScriptableSingleton<UnityEditor.Tilemaps.GridPaintingState>.Save(System.Boolean)
    UnityEditor.ScriptableSingleton<UnityEditor.Tilemaps.GridPaintingState>.GetFilePath()
    UnityEditor.ScriptableSingleton<UnityEditor.Tilemaps.GridPaintingState>.instance
    ScriptableObject.SetDirty()
    ScriptableObject.CreateInstance(String)
    ScriptableObject.CreateInstance(Type)
    ScriptableObject.CreateInstance<T>()
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(Object)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, Boolean)
    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, Boolean)
    Object.Destroy(Object, Single)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, Boolean)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.FindObjectsOfType(Type, Boolean)
    Object.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, Single)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    UnityEngine.Object.FindObjectsOfType<T>(System.Boolean)
    Object.FindObjectOfType<T>()
    UnityEngine.Object.FindObjectOfType<T>(System.Boolean)
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.FindObjectOfType(Type, Boolean)
    Object.ToString()
    Object.name
    Object.hideFlags
    Namespace: UnityEditor.Tilemaps
    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

    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
    Boolean

    lastSceneViewGridPosition

    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
    Boolean

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

    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>

    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>

    validTargetsChanged

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

    Declaration
    public static event Action validTargetsChanged
    Event Type
    Type Description
    Action
    Back to top Copyright © 2022 Unity Technologies
    Generated by DocFX
    on 08 April 2022
    Terms of use