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