Configurable Joint Projection Angle#
Physics 3D / Joint / Configurable Joint / Configurable Joint Projection Angle
Can Read
Can Write
Description#
The Projection Angle property of the Configurable 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]
[Set]
[Title("Configurable Joint Projection Angle")]
[Category("Physics 3D/Joint/Configurable Joint/Projection Angle")]
[Description("The Projection Angle property of the Configurable Joint component")]
[Image(typeof(IconJoint), ColorTheme.Type.Lime, typeof(BadgeCog))]
[Keywords("Physics, 3D")]
[Serializable]
public class GenTypeNumber_ConfigurableJoint_ProjectionAngle : TypeNumber
{
[SerializeField] private GetGameObject m_ConfigurableJoint = new GetGameObject(
new GenTypeGameObject_ConfigurableJoint()
);
public override double GetPreview(GameObject source)
{
GameObject instance = this.m_ConfigurableJoint.GetPreview(source);
if (instance == null) return default;
ConfigurableJoint component = instance.GetComponent<ConfigurableJoint>();
return component != null ? component.projectionAngle : default;
}
public override double Get(Args args)
{
ConfigurableJoint instance = this.m_ConfigurableJoint.Get<ConfigurableJoint>(args);
return instance != null
? instance.projectionAngle
: default;
}
public override void Set(double value, Args args)
{
ConfigurableJoint component = this.m_ConfigurableJoint.Get<ConfigurableJoint>(args);
if (component != null) component.projectionAngle = (float) value;
}
public override string ToString()
{
return $"{this.m_ConfigurableJoint} Projection Angle";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}