Rotation Constraint Weight#
Animation / Constraints / Rotation Constraint / Rotation Constraint Weight
Description#
Compares the Weight property of Rotation Constraint component to another value
Parameters#
| Name | Description |
|---|---|
| Rotation Constraint | |
| Compare | |
| 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("Rotation Constraint Weight")]
[Category("Animation/Constraints/Rotation Constraint/Weight")]
[Description("Compares the Weight property of Rotation Constraint component to another value")]
[Image(typeof(IconQuaternion), ColorTheme.Type.Pink)]
[Keywords("Direction, Euler, Transform")]
[Parameter("Rotation Constraint")]
[Parameter("Compare")]
[Parameter("Value")]
[Serializable]
public class GenConditionNumber_RotationConstraint_CheckWeight : Condition
{
[SerializeField] private GetGameObject m_RotationConstraint = new GetGameObject(
new GenTypeGameObject_RotationConstraint()
);
[SerializeField] private CompareNumber m_Compare = new CompareNumber();
[SerializeField] private GetNumber m_Value = new GetNumber();
protected override string GetTitle(GameObject source)
{
string member = TextUtils.ThemeAsKeyword("Weight");
return $"{this.m_RotationConstraint} {member} {this.m_Compare} {this.m_Value}";
}
protected override bool Run(Args args)
{
RotationConstraint component = this.m_RotationConstraint.Get<RotationConstraint>(args);
if (component == null) return false;
return this.m_Compare.Compare(component.weight, (float) this.m_Value.Get(args));
}
}
}