Constant Force Force#
Physics 3D / Constant Force / Constant Force Force
Description#
Compares the Force property of Constant Force component to another value
Parameters#
| Name | Description |
|---|---|
| Constant Force | |
| 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 Force")]
[Category("Physics 3D/Constant Force/Force")]
[Description("Compares the Force property of Constant Force component to another value")]
[Image(typeof(IconWeight), ColorTheme.Type.Lime)]
[Keywords("Physics, 3D")]
[Parameter("Constant Force")]
[Parameter("Value")]
[Serializable]
public class GenConditionVector3_ConstantForce_CheckForce : Condition
{
[SerializeField] private GetGameObject m_ConstantForce = new GetGameObject(
new GenTypeGameObject_ConstantForce()
);
[SerializeField] private GetVector3 m_Value = new GetVector3();
protected override string GetTitle(GameObject source)
{
string member = TextUtils.ThemeAsKeyword("Force");
return $"{this.m_ConstantForce} {member} = {this.m_Value}";
}
protected override bool Run(Args args)
{
ConstantForce component = this.m_ConstantForce.Get<ConstantForce>(args);
if (component == null) return false;
return component.force == (Vector3) this.m_Value.Get(args);
}
}
}