Text Value#
UI / Graphic / Text / Text Value
Description#
Compares the Value property of Text component to another value
Parameters#
| Name | Description |
|---|---|
| Text | |
| 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;
namespace VisualScript.Runtime
{
[Title("Text Value")]
[Category("UI/Graphic/Text/Value")]
[Description("Compares the Value property of Text component to another value")]
[Image(typeof(IconUIText), ColorTheme.Type.TextLight)]
[Keywords("UI, User, Interface, Label")]
[Parameter("Text")]
[Parameter("Value")]
[Serializable]
public class GenConditionString_Text_CheckText : Condition
{
[SerializeField] private GetGameObject m_Text = new GetGameObject(
new GenTypeGameObject_Text()
);
[SerializeField] private GetString m_Value = new GetString();
protected override string GetTitle(GameObject source)
{
string member = TextUtils.ThemeAsKeyword("Text");
return $"{this.m_Text} {member} = {this.m_Value}";
}
protected override bool Run(Args args)
{
Text component = this.m_Text.Get<Text>(args);
if (component == null) return false;
return component.text == (string) this.m_Value.Get(args);
}
}
}