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