Documentation index for AI agents (llms.txt) A Markdown version of every page is available: request the page's source under /docs/, follow the "alternate" link in this page's head, or start from /llms.txt.
Visual Script logo Manual

Count#

Collections / Count

  • Can Read

  • Cannot Write

Description#

How many items a collection has

Parameters#

Name Description
Collection The collection whose items are counted

Code#

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;
    }
}
Visual Script logoVisual Script © Catsoft Works 2026. All rights reserved.