TMP Text Flexible Width#
UI / Graphic / TMP Text / TMP Text Flexible Width
Description#
Compares the Flexible Width property of TMP Text component to another value
Parameters#
| Name | Description |
|---|---|
| TMP Text | |
| Compare | |
| Value |
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;
using TMPro;
namespace VisualScript.Runtime
{
[Title("TMP Text Flexible Width")]
[Category("UI/Graphic/TMP Text/Flexible Width")]
[Description("Compares the Flexible Width property of TMP Text component to another value")]
[Image(typeof(IconUIText), ColorTheme.Type.Blue)]
[Keywords("UI, User, Interface, TMP, Text, Mesh, Pro")]
[Parameter("TMP Text")]
[Parameter("Compare")]
[Parameter("Value")]
[Serializable]
public class GenConditionNumber_TMP_Text_CheckFlexibleWidth : Condition
{
[SerializeField] private GetGameObject m_TMP_Text = new GetGameObject(
new GenTypeGameObject_TMP_Text()
);
[SerializeField] private CompareNumber m_Compare = new CompareNumber();
[SerializeField] private GetNumber m_Value = new GetNumber();
protected override string GetTitle(GameObject source)
{
string member = TextUtils.ThemeAsKeyword("Flexible Width");
return $"{this.m_TMP_Text} {member} {this.m_Compare} {this.m_Value}";
}
protected override bool Run(Args args)
{
TMP_Text component = this.m_TMP_Text.Get<TMP_Text>(args);
if (component == null) return false;
return this.m_Compare.Compare(component.flexibleWidth, (float) this.m_Value.Get(args));
}
}
}