Hinge Joint Velocity#
Physics 3D / Joint / Hinge Joint / Hinge Joint Velocity
Can Read
Cannot Write
Description#
The Velocity property of the Hinge Joint 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("Hinge Joint Velocity")]
[Category("Physics 3D/Joint/Hinge Joint/Velocity")]
[Description("The Velocity property of the Hinge Joint component")]
[Image(typeof(IconHinge), ColorTheme.Type.Lime)]
[Keywords("Physics, 3D")]
[Serializable]
public class GenTypeNumber_HingeJoint_Velocity : TypeNumber
{
[SerializeField] private GetGameObject m_HingeJoint = new GetGameObject(
new GenTypeGameObject_HingeJoint()
);
public override double GetPreview(GameObject source)
{
GameObject instance = this.m_HingeJoint.GetPreview(source);
if (instance == null) return default;
HingeJoint component = instance.GetComponent<HingeJoint>();
return component != null ? component.velocity : default;
}
public override double Get(Args args)
{
HingeJoint instance = this.m_HingeJoint.Get<HingeJoint>(args);
return instance != null
? instance.velocity
: default;
}
public override string ToString()
{
return $"{this.m_HingeJoint} Velocity";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}