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