Hinge Joint 2D Use Limits#
Physics 2D / Joint / Hinge Joint 2D / Hinge Joint 2D Use Limits
Can Read
Can Write
Description#
The Use Limits property of the Hinge Joint 2D component
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
{
[Get]
[Set]
[Title("Hinge Joint 2D Use Limits")]
[Category("Physics 2D/Joint/Hinge Joint 2D/Use Limits")]
[Description("The Use Limits property of the Hinge Joint 2D component")]
[Image(typeof(IconHinge), ColorTheme.Type.Lime, typeof(Badge2D))]
[Keywords("Physics, 2D")]
[Serializable]
public class GenTypeBool_HingeJoint2D_UseLimits : TypeBool
{
[SerializeField] private GetGameObject m_HingeJoint2D = new GetGameObject(
new GenTypeGameObject_HingeJoint2D()
);
public override bool GetPreview(GameObject source)
{
GameObject instance = this.m_HingeJoint2D.GetPreview(source);
if (instance == null) return default;
HingeJoint2D component = instance.GetComponent<HingeJoint2D>();
return component != null ? component.useLimits : default;
}
public override bool Get(Args args)
{
HingeJoint2D instance = this.m_HingeJoint2D.Get<HingeJoint2D>(args);
return instance != null
? instance.useLimits
: default;
}
public override void Set(bool value, Args args)
{
HingeJoint2D component = this.m_HingeJoint2D.Get<HingeJoint2D>(args);
if (component != null) component.useLimits = (bool) value;
}
public override string ToString()
{
return $"{this.m_HingeJoint2D} Use Limits";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}