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

Bool#

Bool / Bool

  • Can Read

  • Cannot Write

Description#

Returns one when the boolean value is True and zero when it is False

Parameters#

Name Description
Bool The boolean value converted to a number

Code#

using System;
using UnityEngine;
using VisualScript.Icons;

namespace VisualScript.Runtime
{
    [Get]

    [Title("Bool")]
    [Category("Bool/Bool")]

    [Description("Returns one when the boolean value is True and zero when it is False")]
    [Image(typeof(IconToggleOn), ColorTheme.Type.Blue)]

    [Parameter("Bool", "The boolean value converted to a number")]

    [Keywords("Boolean", "True", "False", "One", "Zero", "Convert", "Cast")]

    [Serializable]
    public class TypeNumberBoolGet : TypeNumber
    {
        [SerializeField] private GetBool m_Bool = new GetBool();

        public override double GetPreview(GameObject source) => this.m_Bool.GetPreview(source) ? 1f : 0f;

        public override double Get(Args args)
        {
            return this.m_Bool.Get(args) ? 1f : 0f;
        }

        public override string ToString()
        {
            return this.m_Bool.ToString();
        }

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