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