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