Fixed Joint 2D Reference Angle#
Physics 2D / Joint / Fixed Joint 2D / Fixed Joint 2D Reference Angle
Description#
Compares the Reference Angle property of Fixed Joint 2D component to another value
Parameters#
| Name | Description |
|---|---|
| Fixed Joint 2D | |
| 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;
namespace VisualScript.Runtime
{
[Title("Fixed Joint 2D Reference Angle")]
[Category("Physics 2D/Joint/Fixed Joint 2D/Reference Angle")]
[Description("Compares the Reference Angle property of Fixed Joint 2D component to another value")]
[Image(typeof(IconJoint), ColorTheme.Type.Lime, typeof(Badge2D))]
[Keywords("Physics, 2D")]
[Parameter("Fixed Joint 2D")]
[Parameter("Compare")]
[Parameter("Value")]
[Serializable]
public class GenConditionNumber_FixedJoint2D_CheckReferenceAngle : Condition
{
[SerializeField] private GetGameObject m_FixedJoint2D = new GetGameObject(
new GenTypeGameObject_FixedJoint2D()
);
[SerializeField] private CompareNumber m_Compare = new CompareNumber();
[SerializeField] private GetNumber m_Value = new GetNumber();
protected override string GetTitle(GameObject source)
{
string member = TextUtils.ThemeAsKeyword("Reference Angle");
return $"{this.m_FixedJoint2D} {member} {this.m_Compare} {this.m_Value}";
}
protected override bool Run(Args args)
{
FixedJoint2D component = this.m_FixedJoint2D.Get<FixedJoint2D>(args);
if (component == null) return false;
return this.m_Compare.Compare(component.referenceAngle, (float) this.m_Value.Get(args));
}
}
}