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

Collection Is Empty#

Collections / Collection Is Empty

  • Can Read

  • Cannot Write

Description#

Returns True if the collection does not have any item

Parameters#

Name Description
Collection The collection whose items are counted

Code#

using System;
using UnityEngine;
using VisualScript.Icons;

namespace VisualScript.Runtime
{
    [Get]

    [Title("Collection Is Empty")]
    [Category("Collections/Is Empty")]

    [Description("Returns True if the collection does not have any item")]
    [Image(typeof(IconStack), ColorTheme.Type.Teal, typeof(BadgeCross))]

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

    [Keywords("None", "Zero", "Count", "Length", "Size", "List", "Array")]

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

        public override bool Get(Args args)
        {
            return this.m_Collection.Capture(args) == 0;
        }

        public override string ToString()
        {
            return $"{this.m_Collection} is Empty";
        }

        protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
    }
}
Visual Script logoVisual Script © Catsoft Works 2026. All rights reserved.