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