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

Toggle Is On#

UI / Interaction / Toggle / Toggle Is On

Description#

Compares the Is On property of Toggle component to another value

Parameters#

Name Description
Toggle

Code#

// <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.UI;

namespace VisualScript.Runtime
{
    [Title("Toggle Is On")]
    [Category("UI/Interaction/Toggle/Is On")]
    [Description("Compares the Is On property of Toggle component to another value")]
    
    [Image(typeof(IconToggleOn), ColorTheme.Type.TextLight)]
    [Keywords("UI, User, Interface, Checkbox")]
    
    [Parameter("Toggle")]
    
    [Serializable]
    public class GenConditionBool_Toggle_CheckIsOn : Condition
    {
        [SerializeField] private GetGameObject m_Toggle = new GetGameObject(
            new GenTypeGameObject_Toggle()
        );
        
        protected override string GetTitle(GameObject source)
        {
            string member = TextUtils.ThemeAsKeyword("Is On");
            return $"{this.m_Toggle} {member}";
        }
        
        protected override bool Run(Args args)
        {
            Toggle component = this.m_Toggle.Get<Toggle>(args);
            if (component == null) return false;
            
            return component.isOn;
        }
    }
}

Visual Script logoVisual Script © Catsoft Works 2026. All rights reserved.