Animator Set Trigger#
Animation / Animator / Animator Set Trigger Name
Description#
Executes the Set Trigger method on the Animator component
Parameters#
| Name | Description |
|---|---|
| Name |
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 Set Trigger")]
[Category("Animation/Animator/Set Trigger", "Name")]
[Description("Executes the Set Trigger method on the Animator component")]
[Image(typeof(IconAnimator), ColorTheme.Type.Teal)]
[Keywords("Animation, Clip, Play, Animate")]
[Parameter("Name")]
[Serializable]
public class GenInstructionAnimator_SetTrigger_1_StringName : Instruction
{
[SerializeField] private GetGameObject m_Animator = new GetGameObject(
new GenTypeGameObject_Animator()
);
[SerializeField] private GetString m_Name = new GetString();
protected override string GetTitle(GameObject source)
{
string method = TextUtils.ThemeAsKeyword("Set Trigger");
return $"{this.m_Animator} {method} ({this.m_Name})";
}
protected override Awaitable Run(Args args)
{
Animator component = this.m_Animator.Get<Animator>(args);
if (component == null) return Done;
component.SetTrigger(
(string) this.m_Name.Get(args)
);
return Done;
}
}
}