Parent Constraint Get Rotation Offset#
Animation / Constraints / Parent Constraint / Parent Constraint Get Rotation Offset
Description#
Compares the Get Rotation Offset method of Parent Constraint component to another value
Parameters#
| Name | Description |
|---|---|
| Parent Constraint | |
| 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 Get Rotation Offset")]
[Category("Animation/Constraints/Parent Constraint/Get Rotation Offset")]
[Description("Compares the Get Rotation Offset method of Parent Constraint component to another value")]
[Image(typeof(IconHanger), ColorTheme.Type.Pink)]
[Keywords("Socket, Ancestor, Keep, Track, Follow")]
[Parameter("Parent Constraint")]
[Parameter("Index")]
[Parameter("Value")]
[Serializable]
public class GenConditionVector3_ParentConstraint_CheckGetRotationOffset_1 : Condition
{
[SerializeField] private GetGameObject m_ParentConstraint = new GetGameObject(
new GenTypeGameObject_ParentConstraint()
);
[SerializeField] private GetVector3 m_Value = new GetVector3();
[SerializeField] private GetInteger m_Index = new GetInteger();
protected override string GetTitle(GameObject source)
{
string method = TextUtils.ThemeAsKeyword("Get Rotation Offset");
string parameters = $"({this.m_Index})";
return $"{this.m_ParentConstraint} {method} = {this.m_Value}";
}
protected override bool Run(Args args)
{
ParentConstraint component = this.m_ParentConstraint.Get<ParentConstraint>(args);
if (component == null) return false;
Vector3 value = component.GetRotationOffset(
(int) this.m_Index.Get(args)
);
return value == (Vector3) this.m_Value.Get(args);
}
}
}