docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class RuleEntityIdTile

    Generic visual tile for creating different tilesets like terrain, pipeline, random or animated tiles.

    Inheritance
    object
    Object
    ScriptableObject
    TileBase
    EntityIdTileBase
    RuleEntityIdTile
    HexagonalRuleEntityIdTile
    IsometricRuleEntityIdTile
    Inherited Members
    EntityIdTileBase.refreshTileJobFunction
    EntityIdTileBase.getTileDataJobFunction
    EntityIdTileBase.getTileAnimationDataJobFunction
    TileBase.cachedEntityId
    ScriptableObject.SetDirty()
    ScriptableObject.CreateInstance(string)
    ScriptableObject.CreateInstance(Type)
    ScriptableObject.CreateInstance<T>()
    Object.GetEntityId()
    Object.MemberwiseClone()
    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.FindObjectsByType(Type)
    Object.FindObjectsByType(Type, FindObjectsInactive)
    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.FindObjectsByType<T>()
    Object.FindObjectsByType<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.ReferenceEquals(object, object)
    Namespace: Unity.Tilemaps.Experimental
    Assembly: Unity.2D.Tilemap.Experimental.dll
    Syntax
    [BurstCompile]
    [Serializable]
    [HelpURL("https://docs.unity3d.com/Packages/com.unity.2d.tilemap.extras@latest/index.html?subfolder=/manual/RuleEntityIdTile.html")]
    public class RuleEntityIdTile : EntityIdTileBase

    Fields

    m_TilingRules

    A list of Tiling Rules for the Rule Tile.

    Declaration
    [HideInInspector]
    public List<RuleEntityIdTile.TilingRule> m_TilingRules
    Field Value
    Type Description
    List<RuleEntityIdTile.TilingRule>

    Properties

    defaultColliderType

    The Default Collider Type set when creating a new Rule.

    Declaration
    public Tile.ColliderType defaultColliderType { get; set; }
    Property Value
    Type Description
    Tile.ColliderType

    defaultGameObject

    The Default GameObject set when creating a new Rule.

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

    defaultSprite

    The Default Sprite set when creating a new Rule.

    Declaration
    public Sprite defaultSprite { get; set; }
    Property Value
    Type Description
    Sprite

    getTileAnimationDataJobDelegate

    Returns the delegate function called by Tilemap using Unity Jobs to get Tile Animation Data from RuleEntityIdTiles

    Declaration
    protected override EntityIdTileBase.GetTileAnimationDataJobDelegate getTileAnimationDataJobDelegate { get; }
    Property Value
    Type Description
    EntityIdTileBase.GetTileAnimationDataJobDelegate
    Overrides
    EntityIdTileBase.getTileAnimationDataJobDelegate

    getTileDataJobDelegate

    Returns the delegate function called by Tilemap using Unity Jobs to get Tile Data from RuleEntityIdTiles

    Declaration
    protected override EntityIdTileBase.GetTileDataJobDelegate getTileDataJobDelegate { get; }
    Property Value
    Type Description
    EntityIdTileBase.GetTileDataJobDelegate
    Overrides
    EntityIdTileBase.getTileDataJobDelegate

    m_NeighborType

    Returns the default Neighbor Rule Class type.

    Declaration
    public virtual Type m_NeighborType { get; }
    Property Value
    Type Description
    Type

    m_RotationAngle

    Angle in which the RuleEntityIdTile is rotated by for matching in Degrees.

    Declaration
    public virtual int m_RotationAngle { get; }
    Property Value
    Type Description
    int

    m_RotationCount

    Number of rotations the RuleEntityIdTile can be rotated by for matching.

    Declaration
    public int m_RotationCount { get; }
    Property Value
    Type Description
    int

    neighborPositions

    Returns a set of neighboring positions for this RuleEntityIdTile

    Declaration
    public HashSet<Vector3Int> neighborPositions { get; }
    Property Value
    Type Description
    HashSet<Vector3Int>

    refreshTileJobDelegate

    Returns the delegate function called by Tilemap using Unity Jobs to refresh RuleEntityIdTiles

    Declaration
    protected override EntityIdTileBase.RefreshTileJobDelegate refreshTileJobDelegate { get; }
    Property Value
    Type Description
    EntityIdTileBase.RefreshTileJobDelegate
    Overrides
    EntityIdTileBase.refreshTileJobDelegate

    structType

    Returns the type of data struct used for the RuleEntityIdTile, which is the type of RuleEntityIdTileDataStruct.

    Declaration
    public override Type structType { get; }
    Property Value
    Type Description
    Type
    Overrides
    EntityIdTileBase.structType

    Methods

    CopyDataStruct(void*)

    Copies the Data struct used for this RuleEntityIdTile to the outPtr buffer for use in Unity Jobs.

    Declaration
    public override void CopyDataStruct(void* outPtr)
    Parameters
    Type Name Description
    void* outPtr

    Data buffer to copy data struct from RuleEntityIdTile to.

    Overrides
    EntityIdTileBase.CopyDataStruct(void*)

    GetMirroredPosition(int3, bool, bool)

    Gets a mirrored position given its original position and the mirroring axii.

    Declaration
    public virtual int3 GetMirroredPosition(int3 position, bool mirrorX, bool mirrorY)
    Parameters
    Type Name Description
    int3 position

    Original position of Tile.

    bool mirrorX

    Mirror in the X Axis.

    bool mirrorY

    Mirror in the Y Axis.

    Returns
    Type Description
    int3

    Mirrored position of Tile.

    GetOffsetPosition(int3, int3)

    Get the offset for the given position with the given offset.

    Declaration
    public virtual int3 GetOffsetPosition(int3 position, int3 offset)
    Parameters
    Type Name Description
    int3 position

    Position to offset.

    int3 offset

    Offset for the position.

    Returns
    Type Description
    int3

    The offset position.

    GetOffsetPositionReverse(int3, int3)

    Get the reversed offset for the given position with the given offset.

    Declaration
    public virtual int3 GetOffsetPositionReverse(int3 position, int3 offset)
    Parameters
    Type Name Description
    int3 position

    Position to offset.

    int3 offset

    Offset for the position.

    Returns
    Type Description
    int3

    The reversed offset position.

    GetPerlinValue(ref int3, float, float)

    Returns a Perlin Noise value based on the given inputs.

    Declaration
    [BurstCompile]
    public static float GetPerlinValue(ref int3 position, float scale, float offset)
    Parameters
    Type Name Description
    int3 position

    Position of the Tile on the Tilemap.

    float scale

    The Perlin Scale factor of the Tile.

    float offset

    Offset of the Tile on the Tilemap.

    Returns
    Type Description
    float

    A Perlin Noise value based on the given inputs.

    GetRotatedPosition(int3, int)

    Gets a rotated position given its original position and the rotation in degrees.

    Declaration
    public virtual int3 GetRotatedPosition(int3 position, int rotation)
    Parameters
    Type Name Description
    int3 position

    Original position of Tile.

    int rotation

    Rotation in degrees.

    Returns
    Type Description
    int3

    Rotated position of Tile.

    GetTileAnimationData(Vector3Int, ITilemap, ref TileAnimationData)

    Retrieves any tile animation data from the scripted tile.

    Declaration
    public override bool GetTileAnimationData(Vector3Int position, ITilemap tilemap, ref TileAnimationData tileAnimationData)
    Parameters
    Type Name Description
    Vector3Int position

    Position of the Tile on the Tilemap.

    ITilemap tilemap

    The Tilemap the tile is present on.

    TileAnimationData tileAnimationData

    Data to run an animation on the tile.

    Returns
    Type Description
    bool

    Whether the call was successful.

    Overrides
    UnityEngine.Tilemaps.TileBase.GetTileAnimationData(UnityEngine.Vector3Int, UnityEngine.Tilemaps.ITilemap, ref UnityEngine.Tilemaps.TileAnimationData)

    GetTileData(Vector3Int, ITilemap, ref TileData)

    Retrieves any tile rendering data from the scripted tile.

    Declaration
    public override void GetTileData(Vector3Int position, ITilemap tilemap, ref TileData tileData)
    Parameters
    Type Name Description
    Vector3Int position

    Position of the Tile on the Tilemap.

    ITilemap tilemap

    The Tilemap the tile is present on.

    TileData tileData

    Data to render the tile.

    Overrides
    UnityEngine.Tilemaps.TileBase.GetTileData(UnityEngine.Vector3Int, UnityEngine.Tilemaps.ITilemap, ref UnityEngine.Tilemaps.TileData)

    OnDisable()

    Cleans up the RuleEntityIdTile.

    Declaration
    public override void OnDisable()
    Overrides
    TileBase.OnDisable()

    OnEnable()

    Initializes the RuleEntityIdTile.

    Declaration
    public override void OnEnable()
    Overrides
    EntityIdTileBase.OnEnable()

    RefreshTile(Vector3Int, ITilemap)

    This method is called when the tile is refreshed.

    Declaration
    public override void RefreshTile(Vector3Int position, ITilemap tilemap)
    Parameters
    Type Name Description
    Vector3Int position

    Position of the Tile on the Tilemap.

    ITilemap tilemap

    The Tilemap the tile is present on.

    Overrides
    TileBase.RefreshTile(Vector3Int, ITilemap)

    RuleMatch(int, in EntityId, in EntityId)

    Checks if there is a match given the neighbor matching rule and a Tile.

    Declaration
    [BurstCompile]
    public static bool RuleMatch(int neighborRule, in EntityId thisOne, in EntityId otherOne)
    Parameters
    Type Name Description
    int neighborRule

    Neighbor matching rule.

    EntityId thisOne

    Tile to match.

    EntityId otherOne

    Other Tile to match.

    Returns
    Type Description
    bool

    True if there is a match, False if not.

    RuleMatches(ref RuleMatchInput, ref TilemapDataStruct, ref RuleEntityIdTileDataStruct, ref int3, bool, bool)

    Checks if there is a match given the neighbor matching rule and a Tile with mirrored axii.

    Declaration
    [BurstCompile]
    public static bool RuleMatches(ref RuleMatchInput ruleMatch, ref TilemapDataStruct tilemapData, ref RuleEntityIdTile.RuleEntityIdTileDataStruct tileData, ref int3 position, bool mirrorX, bool mirrorY)
    Parameters
    Type Name Description
    RuleMatchInput ruleMatch

    Neighbor matching rule.

    TilemapDataStruct tilemapData

    Tilemap to match.

    RuleEntityIdTile.RuleEntityIdTileDataStruct tileData

    Tile to match.

    int3 position

    Position of the Tile on the Tilemap.

    bool mirrorX

    Mirror X Axis for matching.

    bool mirrorY

    Mirror Y Axis for matching.

    Returns
    Type Description
    bool

    True if there is a match, False if not.

    RuleMatches(ref RuleMatchInput, ref TilemapDataStruct, ref RuleEntityIdTileDataStruct, ref int3, int, bool)

    Checks if there is a match given the neighbor matching rule and a Tile with a rotation angle.

    Declaration
    [BurstCompile]
    public static bool RuleMatches(ref RuleMatchInput ruleMatch, ref TilemapDataStruct tilemapData, ref RuleEntityIdTile.RuleEntityIdTileDataStruct tileData, ref int3 position, int angle, bool mirrorX = false)
    Parameters
    Type Name Description
    RuleMatchInput ruleMatch

    Neighbor matching rule.

    TilemapDataStruct tilemapData

    Tilemap to match.

    RuleEntityIdTile.RuleEntityIdTileDataStruct tileData

    Tile to match.

    int3 position

    Position of the Tile on the Tilemap.

    int angle

    Rotation angle for matching.

    bool mirrorX

    Mirror X Axis for matching.

    Returns
    Type Description
    bool

    True if there is a match, False if not.

    RuleMatches(ref RuleMatchInput, ref TilemapDataStruct, ref RuleEntityIdTileDataStruct, ref int3, ref AffineTransform)

    Does a Rule Match given a Tiling Rule and neighboring Tiles.

    Declaration
    [BurstCompile]
    public static bool RuleMatches(ref RuleMatchInput ruleMatch, ref TilemapDataStruct tilemapData, ref RuleEntityIdTile.RuleEntityIdTileDataStruct tileData, ref int3 position, ref AffineTransform transform)
    Parameters
    Type Name Description
    RuleMatchInput ruleMatch

    The Tiling Rule to match with.

    TilemapDataStruct tilemapData

    The tilemap to match with.

    RuleEntityIdTile.RuleEntityIdTileDataStruct tileData

    The Tile's data as a struct.

    int3 position

    Position of the Tile on the Tilemap.

    AffineTransform transform

    A transform matrix which will match the Rule.

    Returns
    Type Description
    bool

    True if there is a match, False if not.

    StartUp(Vector3Int, ITilemap, GameObject)

    StartUp is called on the first frame of the running Scene.

    Declaration
    public override bool StartUp(Vector3Int position, ITilemap tilemap, GameObject instantiatedGameObject)
    Parameters
    Type Name Description
    Vector3Int position

    Position of the Tile on the Tilemap.

    ITilemap tilemap

    The Tilemap the tile is present on.

    GameObject instantiatedGameObject

    The GameObject instantiated for the Tile.

    Returns
    Type Description
    bool

    Whether StartUp was successful

    Overrides
    TileBase.StartUp(Vector3Int, ITilemap, GameObject)

    UpdateNeighborPositions(ref NativeHashSet<int3>, ref BoundsInt)

    Updates the neighboring positions of this RuleEntityIdTile

    Declaration
    protected void UpdateNeighborPositions(ref NativeHashSet<int3> refNeighborPositions, ref BoundsInt refBounds)
    Parameters
    Type Name Description
    NativeHashSet<int3> refNeighborPositions

    Neighbor positions

    BoundsInt refBounds

    Bounds of the neighboring positions

    In This Article
    Back to top
    Copyright © 2026 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)