Wheel Joint 2D Joint Translation#
Physics 2D / Joint / Wheel Joint 2D / Wheel Joint 2D Joint Translation
Description#
Compares the Joint Translation property of Wheel Joint 2D component to another value
Parameters#
| Name | Description |
|---|---|
| Wheel 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("Wheel Joint 2D Joint Translation")]
[Category("Physics 2D/Joint/Wheel Joint 2D/Joint Translation")]
[Description("Compares the Joint Translation property of Wheel Joint 2D component to another value")]
[Image(typeof(IconWheel), ColorTheme.Type.Lime, typeof(Badge2D))]
[Keywords("Physics, 2D")]
[Parameter("Wheel Joint 2D")]
[Parameter("Compare")]
[Parameter("Value")]
[Serializable]
public class GenConditionNumber_WheelJoint2D_CheckJointTranslation : Condition
{
[SerializeField] private GetGameObject m_WheelJoint2D = new GetGameObject(
new GenTypeGameObject_WheelJoint2D()
);
[SerializeField] private CompareNumber m_Compare = new CompareNumber();
[SerializeField] private GetNumber m_Value = new GetNumber();
protected override string GetTitle(GameObject source)
{
string member = TextUtils.ThemeAsKeyword("Joint Translation");
return $"{this.m_WheelJoint2D} {member} {this.m_Compare} {this.m_Value}";
}
protected override bool Run(Args args)
{
WheelJoint2D component = this.m_WheelJoint2D.Get<WheelJoint2D>(args);
if (component == null) return false;
return this.m_Compare.Compare(component.jointTranslation, (float) this.m_Value.Get(args));
}
}
}