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