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