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

Scroll Rect Vertical Scrollbar#

UI / Scroll / Scroll Rect / Scroll Rect Vertical Scrollbar

  • Can Read

  • Can Write

Description#

The Vertical Scrollbar property of the Scroll Rect component

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
{
    [Get]
    [Set]
    
    [Title("Scroll Rect Vertical Scrollbar")]
    [Category("UI/Scroll/Scroll Rect/Vertical Scrollbar")]
    [Description("The Vertical Scrollbar property of the Scroll Rect component")]
    
    [Image(typeof(IconScrollRect), ColorTheme.Type.TextLight)]
    [Keywords("UI, User, Interface")]
    
    [Serializable]
    public class GenTypeGameObject_ScrollRect_VerticalScrollbar : TypeGameObject
    {
        [SerializeField] private GetGameObject m_ScrollRect = new GetGameObject(
            new GenTypeGameObject_ScrollRect()
        );
        
        public override GameObject GetPreview(GameObject source)
        {
            GameObject instance = this.m_ScrollRect.GetPreview(source);
            if (instance == null) return default;
            
            ScrollRect component = instance.GetComponent<ScrollRect>();
            return component != null ? component.verticalScrollbar.gameObject : default;
        }
        
        public override GameObject Get(Args args)
        {
            ScrollRect instance = this.m_ScrollRect.Get<ScrollRect>(args);
            return instance != null
                ? instance.verticalScrollbar.gameObject
                : default;
        }
        
        public override U Get<U>(Args args)
        {
            if (typeof(U) == typeof(ScrollRect))
            {
                ScrollRect instance = this.m_ScrollRect.Get<ScrollRect>(args);
                return instance != null
                    ? instance.verticalScrollbar as U
                    : default;
            }
            
            return base.Get<U>(args);
        }
        
        public override void Set(GameObject value, Args args)
        {
            ScrollRect component = this.m_ScrollRect.Get<ScrollRect>(args);
            if (component != null) component.verticalScrollbar = (Scrollbar) value.Get<UnityEngine.UI.Scrollbar>();
        }
        
        public override void Set<U>(U value, Args args)
        {
            if (typeof(U) == typeof(Scrollbar))
            {
                ScrollRect component = this.m_ScrollRect.Get<ScrollRect>(args);
                if (component != null) component.verticalScrollbar = value as Scrollbar;
            }
            
            base.Set<U>(value, args);
        }
        
        public override string ToString()
        {
            return $"{this.m_ScrollRect} Vertical Scrollbar";
        }
        
        protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
    }
}

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