Transform Find#
Transform / Hierarchy / Transform Find
Description#
Finds a child by name and returns it
Parameters#
| Name | Description |
|---|---|
| Transform | |
| Name | |
| 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;
namespace VisualScript.Runtime
{
[Title("Transform Find")]
[Category("Transform/Hierarchy/Find")]
[Description("Finds a child by name and returns it")]
[Image(typeof(IconTransform), ColorTheme.Type.Lime, typeof(BadgeMagnifier))]
[Keywords("Transform")]
[Parameter("Transform")]
[Parameter("Name")]
[Parameter("Value")]
[Serializable]
public class GenConditionGameObject_Transform_CheckFind_1 : Condition
{
[SerializeField] private GetGameObject m_Transform = new GetGameObject(
new GenTypeGameObject_Transform()
);
[SerializeField] private GetGameObject m_Value = new GetGameObject();
[SerializeField] private GetString m_Name = new GetString();
protected override string GetTitle(GameObject source)
{
string method = TextUtils.ThemeAsKeyword("Find");
string parameters = $"({this.m_Name})";
return $"{this.m_Transform} {method} = {this.m_Value}";
}
protected override bool Run(Args args)
{
Transform component = this.m_Transform.Get<Transform>(args);
if (component == null) return false;
Transform value = component.Find(
(string) this.m_Name.Get(args)
);
return value == this.m_Value.Get<Transform>(args);
}
}
}