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