Set Joint 2D Connected Body#
Physics 2D / Joint 2D / Set Joint 2D Connected Body
Description#
Sets the Connected Body property of Joint 2D component
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("Set Joint 2D Connected Body")]
[Category("Physics 2D/Joint 2D/Connected Body")]
[Description("Sets the Connected Body property of Joint 2D component")]
[Image(typeof(IconJoint), ColorTheme.Type.Lime, typeof(Badge2D))]
[Keywords("Physics, 2D")]
[Parameter("Joint 2D")]
[Parameter("Value")]
[Serializable]
public class GenInstructionGameObject_Joint2D_SetConnectedBody : Instruction
{
[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("Connected Body");
return $"{this.m_Joint2D} {member} = {this.m_Value}";
}
protected override Awaitable Run(Args args)
{
Joint2D component = this.m_Joint2D.Get<Joint2D>(args);
if (component == null) return Done;
component.connectedBody = this.m_Value.Get<Rigidbody2D>(args);
return Done;
}
}
}