Joint 2D Attached Rigidbody#
Physics 2D / Joint 2D / Joint 2D Attached Rigidbody
Description#
Compares the Attached Rigidbody property of Joint 2D component to another value
Parameters#
| Name | Description |
|---|---|
| Joint 2D | |
| 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("Joint 2D Attached Rigidbody")]
[Category("Physics 2D/Joint 2D/Attached Rigidbody")]
[Description("Compares the Attached Rigidbody property of Joint 2D component to another value")]
[Image(typeof(IconJoint), ColorTheme.Type.Lime, typeof(Badge2D))]
[Keywords("Physics, 2D")]
[Parameter("Joint 2D")]
[Parameter("Value")]
[Serializable]
public class GenConditionGameObject_Joint2D_CheckAttachedRigidbody : Condition
{
[SerializeField] private GetGameObject m_Joint2D = new GetGameObject(
new GenTypeGameObject_Joint2D()
);
[SerializeField] private GetGameObject m_Value = new GetGameObject();
protected override string GetTitle(GameObject source)
{
string member = TextUtils.ThemeAsKeyword("Attached Rigidbody");
return $"{this.m_Joint2D} {member} = {this.m_Value}";
}
protected override bool Run(Args args)
{
Joint2D component = this.m_Joint2D.Get<Joint2D>(args);
if (component == null) return false;
return component.attachedRigidbody == this.m_Value.Get<Rigidbody2D>(args);
}
}
}