Scroll Rect Max Width#
UI / Scroll / Scroll Rect / Scroll Rect Max Width
Can Read
Cannot Write
Description#
The Max Width 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]
[Title("Scroll Rect Max Width")]
[Category("UI/Scroll/Scroll Rect/Max Width")]
[Description("The Max Width property of the Scroll Rect component")]
[Image(typeof(IconScrollRect), ColorTheme.Type.TextLight)]
[Keywords("UI, User, Interface")]
[Serializable]
public class GenTypeNumber_ScrollRect_MaxWidth : 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.maxWidth : default;
}
public override double Get(Args args)
{
ScrollRect instance = this.m_ScrollRect.Get<ScrollRect>(args);
return instance != null
? instance.maxWidth
: default;
}
public override string ToString()
{
return $"{this.m_ScrollRect} Max Width";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}