---
tags:
    - "Length"
    - "Size"
    - "Amount"
    - "Total"
    - "List"
    - "Array"
---

# Count

[Collections](index.md) / **Count**

<div class="grid cards" markdown>

* :green_circle: Can Read

* :red_circle: Cannot Write

</div>

## Description

How many items a collection has

## Parameters

| Name | Description |
| :--- | :---------- |
| Collection | The collection whose items are counted |

## Code

```cs
using System;
using UnityEngine;
using VisualScript.Icons;

namespace VisualScript.Runtime
{
    [Get]

    [Title("Count")]
    [Category("Collections/Count")]

    [Description("How many items a collection has")]
    [Image(typeof(IconStack), ColorTheme.Type.Teal, typeof(BadgeHash))]

    [Parameter("Collection", "The collection whose items are counted")]

    [Keywords("Length", "Size", "Amount", "Total", "List", "Array")]

    [Serializable]
    public class TypeNumberCollectionCount : TypeNumber
    {
        [SerializeField] private GetCollection m_Collection = new GetCollection();

        public override double Get(Args args)
        {
            return this.m_Collection.Capture(args);
        }

        public override string ToString()
        {
            return $"Count of {this.m_Collection}";
        }

        protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
    }
}

```

