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