Tilemap Tile Anchor#
Tilemap / Tilemap Tile Anchor
Description#
Compares the Tile Anchor property of Tilemap component to another value
Parameters#
| Name | Description |
|---|---|
| Tilemap | |
| Value |
Code#
// <auto-generated>
// This script was automatically generated using the Visual Script Transpiler.
// Do not modify. Changes to this file will be lost when updating the package.
// </auto-generated>
using System;
using UnityEngine;
using VisualScript.Icons;
using UnityEngine.Tilemaps;
using Unity.Collections;
namespace VisualScript.Runtime
{
[Title("Tilemap Tile Anchor")]
[Category("Tilemap/Tile Anchor")]
[Description("Compares the Tile Anchor property of Tilemap component to another value")]
[Image(typeof(IconTilemap), ColorTheme.Type.Purple)]
[Keywords("Tile, Map")]
[Parameter("Tilemap")]
[Parameter("Value")]
[Serializable]
public class GenConditionVector3_Tilemap_CheckTileAnchor : Condition
{
[SerializeField] private GetGameObject m_Tilemap = new GetGameObject(
new GenTypeGameObject_Tilemap()
);
[SerializeField] private GetVector3 m_Value = new GetVector3();
protected override string GetTitle(GameObject source)
{
string member = TextUtils.ThemeAsKeyword("Tile Anchor");
return $"{this.m_Tilemap} {member} = {this.m_Value}";
}
protected override bool Run(Args args)
{
Tilemap component = this.m_Tilemap.Get<Tilemap>(args);
if (component == null) return false;
return component.tileAnchor == (Vector3) this.m_Value.Get(args);
}
}
}