Text Min Height#
UI / Graphic / Text / Text Min Height
Can Read
Cannot Write
Description#
The Min Height property of the Text 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("Text Min Height")]
[Category("UI/Graphic/Text/Min Height")]
[Description("The Min Height property of the Text component")]
[Image(typeof(IconUIText), ColorTheme.Type.TextLight)]
[Keywords("UI, User, Interface, Label")]
[Serializable]
public class GenTypeNumber_Text_MinHeight : TypeNumber
{
[SerializeField] private GetGameObject m_Text = new GetGameObject(
new GenTypeGameObject_Text()
);
public override double GetPreview(GameObject source)
{
GameObject instance = this.m_Text.GetPreview(source);
if (instance == null) return default;
Text component = instance.GetComponent<Text>();
return component != null ? component.minHeight : default;
}
public override double Get(Args args)
{
Text instance = this.m_Text.Get<Text>(args);
return instance != null
? instance.minHeight
: default;
}
public override string ToString()
{
return $"{this.m_Text} Min Height";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}