Tilemap Get Used Sprites Count#
Tilemap / Tilemap Get Used Sprites Count
Description#
Compares the Get Used Sprites Count method of Tilemap component to another value
Parameters#
| Name | Description |
|---|---|
| Tilemap | |
| Compare | |
| 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 Get Used Sprites Count")]
[Category("Tilemap/Get Used Sprites Count")]
[Description("Compares the Get Used Sprites Count method of Tilemap component to another value")]
[Image(typeof(IconTilemap), ColorTheme.Type.Purple)]
[Keywords("Tile, Map")]
[Parameter("Tilemap")]
[Parameter("Compare")]
[Parameter("Value")]
[Serializable]
public class GenConditionInteger_Tilemap_CheckGetUsedSpritesCount_0 : Condition
{
[SerializeField] private GetGameObject m_Tilemap = new GetGameObject(
new GenTypeGameObject_Tilemap()
);
[SerializeField] private CompareNumber m_Compare = new CompareNumber();
[SerializeField] private GetInteger m_Value = new GetInteger();
protected override string GetTitle(GameObject source)
{
string method = TextUtils.ThemeAsKeyword("Get Used Sprites Count");
string parameters = $"()";
return $"{this.m_Tilemap} {method} {this.m_Compare} {this.m_Value}";
}
protected override bool Run(Args args)
{
Tilemap component = this.m_Tilemap.Get<Tilemap>(args);
if (component == null) return false;
int value = component.GetUsedSpritesCount();
return this.m_Compare.Compare(value, (int) this.m_Value.Get(args));
}
}
}