TMP Text Max Visible Characters#
UI / Graphic / TMP Text / TMP Text Max Visible Characters
Can Read
Can Write
Description#
The Max Visible Characters property of the TMP 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;
using TMPro;
namespace VisualScript.Runtime
{
[Get]
[Set]
[Title("TMP Text Max Visible Characters")]
[Category("UI/Graphic/TMP Text/Max Visible Characters")]
[Description("The Max Visible Characters property of the TMP Text component")]
[Image(typeof(IconUIText), ColorTheme.Type.Blue)]
[Keywords("UI, User, Interface, TMP, Text, Mesh, Pro")]
[Serializable]
public class GenTypeInteger_TMP_Text_MaxVisibleCharacters : TypeNumber
{
[SerializeField] private GetGameObject m_TMP_Text = new GetGameObject(
new GenTypeGameObject_TMP_Text()
);
public override double GetPreview(GameObject source)
{
GameObject instance = this.m_TMP_Text.GetPreview(source);
if (instance == null) return default;
TMP_Text component = instance.GetComponent<TMP_Text>();
return component != null ? component.maxVisibleCharacters : default;
}
public override double Get(Args args)
{
TMP_Text instance = this.m_TMP_Text.Get<TMP_Text>(args);
return instance != null
? instance.maxVisibleCharacters
: default;
}
public override void Set(double value, Args args)
{
TMP_Text component = this.m_TMP_Text.Get<TMP_Text>(args);
if (component != null) component.maxVisibleCharacters = (int) value;
}
public override string ToString()
{
return $"{this.m_TMP_Text} Max Visible Characters";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}