Layout Element Min Width#
UI / Layout / Layout Element / Layout Element Min Width
Can Read
Can Write
Description#
The Min Width property of the Layout Element 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("Layout Element Min Width")]
[Category("UI/Layout/Layout Element/Min Width")]
[Description("The Min Width property of the Layout Element component")]
[Image(typeof(IconLayoutElement), ColorTheme.Type.TextLight)]
[Keywords("UI, Layout")]
[Serializable]
public class GenTypeNumber_LayoutElement_MinWidth : TypeNumber
{
[SerializeField] private GetGameObject m_LayoutElement = new GetGameObject(
new GenTypeGameObject_LayoutElement()
);
public override double GetPreview(GameObject source)
{
GameObject instance = this.m_LayoutElement.GetPreview(source);
if (instance == null) return default;
LayoutElement component = instance.GetComponent<LayoutElement>();
return component != null ? component.minWidth : default;
}
public override double Get(Args args)
{
LayoutElement instance = this.m_LayoutElement.Get<LayoutElement>(args);
return instance != null
? instance.minWidth
: default;
}
public override void Set(double value, Args args)
{
LayoutElement component = this.m_LayoutElement.Get<LayoutElement>(args);
if (component != null) component.minWidth = (float) value;
}
public override string ToString()
{
return $"{this.m_LayoutElement} Min Width";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}