mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 13:01:52 +00:00
Get/Set FixedRotation in play mode
This commit is contained in:
@@ -75,7 +75,7 @@ public class Rigidbody2D : Component
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the angulara velocity of the rigidbody.
|
||||
/// Gets or sets the angular velocity of the rigidbody.
|
||||
/// </summary>
|
||||
public float AngularVelocity
|
||||
{
|
||||
@@ -87,4 +87,18 @@ public class Rigidbody2D : Component
|
||||
}
|
||||
set => ScriptGlue.Rigidbody2D_SetAngularVelocity(_uuid, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets whether the rigidbody can rotate or not.
|
||||
/// </summary>
|
||||
public bool FixedRotation
|
||||
{
|
||||
get
|
||||
{
|
||||
ScriptGlue.Rigidbody2D_IsFixedRotation(_uuid, out bool isFixedRotation);
|
||||
|
||||
return isFixedRotation;
|
||||
}
|
||||
set => ScriptGlue.Rigidbody2D_SetFixedRotation(_uuid, value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,7 +112,13 @@ internal static class ScriptGlue
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
internal static extern void Rigidbody2D_GetAngularVelocity(UUID entityId, out float velocity);
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
internal static extern void Rigidbody2D_IsFixedRotation(UUID entityId, out bool isFixedRotation);
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
internal static extern void Rigidbody2D_SetFixedRotation(UUID entityId, in bool isFixedRotation);
|
||||
|
||||
#endregion RigidBody2D
|
||||
|
||||
#region Camera
|
||||
|
||||
Reference in New Issue
Block a user