Parent Constraint Set Rotation Offset#
Animation / Constraints / Parent Constraint / Parent Constraint Set Rotation Offset
Description#
Executes the Set Rotation Offset method on the Parent Constraint component
Parameters#
| Name | Description |
|---|---|
| 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;
using UnityEngine.Animations;
namespace VisualScript.Runtime
{
[Title("Parent Constraint Set Rotation Offset")]
[Category("Animation/Constraints/Parent Constraint/Set Rotation Offset")]
[Description("Executes the Set Rotation Offset method on the Parent Constraint component")]
[Image(typeof(IconHanger), ColorTheme.Type.Pink)]
[Keywords("Socket, Ancestor, Keep, Track, Follow")]
[Parameter("Index")]
[Parameter("Value")]
[Serializable]
public class GenInstructionParentConstraint_SetRotationOffset_2 : Instruction
{
[SerializeField] private GetGameObject m_ParentConstraint = new GetGameObject(
new GenTypeGameObject_ParentConstraint()
);
[SerializeField] private GetInteger m_Index = new GetInteger();
[SerializeField] private GetVector3 m_Value = new GetVector3();
protected override string GetTitle(GameObject source)
{
string method = TextUtils.ThemeAsKeyword("Set Rotation Offset");
return $"{this.m_ParentConstraint} {method} ({this.m_Index}, {this.m_Value})";
}
protected override Awaitable Run(Args args)
{
ParentConstraint component = this.m_ParentConstraint.Get<ParentConstraint>(args);
if (component == null) return Done;
component.SetRotationOffset(
(int) this.m_Index.Get(args),
(Vector3) this.m_Value.Get(args)
);
return Done;
}
}
}