---
tags:
    - "Tile, Map"
---

# Tilemap Get Used Tiles Count

[Tilemap](index.md) / **Tilemap Get Used Tiles Count**

## Description

Compares the Get Used Tiles Count method of Tilemap component to another value

## Parameters

| Name | Description |
| :--- | :---------- |
| Tilemap |  |
| Compare |  |
| Value |  |

## Code

```cs
// <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 Tiles Count")]
    [Category("Tilemap/Get Used Tiles Count")]
    [Description("Compares the Get Used Tiles 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_CheckGetUsedTilesCount_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 Tiles 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.GetUsedTilesCount();
            
            return this.m_Compare.Compare(value, (int) this.m_Value.Get(args));
        }
    }
}


```

