Fixed Joint 2D Damping Ratio#
Physics 2D / Joint / Fixed Joint 2D / Fixed Joint 2D Damping Ratio
Can Read
Can Write
Description#
The Damping Ratio property of the Fixed 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("Fixed Joint 2D Damping Ratio")]
[Category("Physics 2D/Joint/Fixed Joint 2D/Damping Ratio")]
[Description("The Damping Ratio property of the Fixed Joint 2D component")]
[Image(typeof(IconJoint), ColorTheme.Type.Lime, typeof(Badge2D))]
[Keywords("Physics, 2D")]
[Serializable]
public class GenTypeNumber_FixedJoint2D_DampingRatio : TypeNumber
{
[SerializeField] private GetGameObject m_FixedJoint2D = new GetGameObject(
new GenTypeGameObject_FixedJoint2D()
);
public override double GetPreview(GameObject source)
{
GameObject instance = this.m_FixedJoint2D.GetPreview(source);
if (instance == null) return default;
FixedJoint2D component = instance.GetComponent<FixedJoint2D>();
return component != null ? component.dampingRatio : default;
}
public override double Get(Args args)
{
FixedJoint2D instance = this.m_FixedJoint2D.Get<FixedJoint2D>(args);
return instance != null
? instance.dampingRatio
: default;
}
public override void Set(double value, Args args)
{
FixedJoint2D component = this.m_FixedJoint2D.Get<FixedJoint2D>(args);
if (component != null) component.dampingRatio = (float) value;
}
public override string ToString()
{
return $"{this.m_FixedJoint2D} Damping Ratio";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}