Slider Joint 2D Joint Translation#
Physics 2D / Joint / Slider Joint 2D / Slider Joint 2D Joint Translation
Can Read
Cannot Write
Description#
The Joint Translation property of the Slider 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]
[Title("Slider Joint 2D Joint Translation")]
[Category("Physics 2D/Joint/Slider Joint 2D/Joint Translation")]
[Description("The Joint Translation property of the Slider Joint 2D component")]
[Image(typeof(IconSliderJoint), ColorTheme.Type.Lime, typeof(Badge2D))]
[Keywords("Physics, 2D")]
[Serializable]
public class GenTypeNumber_SliderJoint2D_JointTranslation : TypeNumber
{
[SerializeField] private GetGameObject m_SliderJoint2D = new GetGameObject(
new GenTypeGameObject_SliderJoint2D()
);
public override double GetPreview(GameObject source)
{
GameObject instance = this.m_SliderJoint2D.GetPreview(source);
if (instance == null) return default;
SliderJoint2D component = instance.GetComponent<SliderJoint2D>();
return component != null ? component.jointTranslation : default;
}
public override double Get(Args args)
{
SliderJoint2D instance = this.m_SliderJoint2D.Get<SliderJoint2D>(args);
return instance != null
? instance.jointTranslation
: default;
}
public override string ToString()
{
return $"{this.m_SliderJoint2D} Joint Translation";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}