Rect Transform Get Local Top#
UI / Layout / Rect Transform / Rect Transform Get Local Top
Description#
Compares the Get Local Top method of Rect Transform component to another value
Parameters#
| Name | Description |
|---|---|
| Rect Transform | |
| 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;
namespace VisualScript.Runtime
{
[Title("Rect Transform Get Local Top")]
[Category("UI/Layout/Rect Transform/Get Local Top")]
[Description("Compares the Get Local Top method of Rect Transform component to another value")]
[Image(typeof(IconRectTransform), ColorTheme.Type.TextLight)]
[Keywords("UI, Layout")]
[Parameter("Rect Transform")]
[Parameter("Compare")]
[Parameter("Value")]
[Serializable]
public class GenConditionNumber_RectTransform_CheckGetLocalTop_0 : Condition
{
[SerializeField] private GetGameObject m_RectTransform = new GetGameObject(
new GenTypeGameObject_RectTransform()
);
[SerializeField] private CompareNumber m_Compare = new CompareNumber();
[SerializeField] private GetNumber m_Value = new GetNumber();
protected override string GetTitle(GameObject source)
{
string method = TextUtils.ThemeAsKeyword("Get Local Top");
string parameters = $"()";
return $"{this.m_RectTransform} {method} {this.m_Compare} {this.m_Value}";
}
protected override bool Run(Args args)
{
RectTransform component = this.m_RectTransform.Get<RectTransform>(args);
if (component == null) return false;
float value = component.GetLocalTop();
return this.m_Compare.Compare(value, (float) this.m_Value.Get(args));
}
}
}