Animator Get Layer Name#
Animation / Animator / Animator Get Layer Name
Description#
Compares the Get Layer Name method of Animator component to another value
Parameters#
| Name | Description |
|---|---|
| Animator | |
| Layer Index | |
| 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("Animator Get Layer Name")]
[Category("Animation/Animator/Get Layer Name")]
[Description("Compares the Get Layer Name method of Animator component to another value")]
[Image(typeof(IconAnimator), ColorTheme.Type.Teal)]
[Keywords("Animation, Clip, Play, Animate")]
[Parameter("Animator")]
[Parameter("Layer Index")]
[Parameter("Value")]
[Serializable]
public class GenConditionString_Animator_CheckGetLayerName_1 : Condition
{
[SerializeField] private GetGameObject m_Animator = new GetGameObject(
new GenTypeGameObject_Animator()
);
[SerializeField] private GetString m_Value = new GetString();
[SerializeField] private GetInteger m_LayerIndex = new GetInteger();
protected override string GetTitle(GameObject source)
{
string method = TextUtils.ThemeAsKeyword("Get Layer Name");
string parameters = $"({this.m_LayerIndex})";
return $"{this.m_Animator} {method} = {this.m_Value}";
}
protected override bool Run(Args args)
{
Animator component = this.m_Animator.Get<Animator>(args);
if (component == null) return false;
string value = component.GetLayerName(
(int) this.m_LayerIndex.Get(args)
);
return value == (string) this.m_Value.Get(args);
}
}
}