mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 13:01:52 +00:00
Added basic component access in Scripts
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
using GlitchyEngine.Core;
|
||||
using GlitchyEngine.Math;
|
||||
@@ -9,8 +10,37 @@ namespace GlitchyEngine;
|
||||
/// </summary>
|
||||
internal static class ScriptGlue
|
||||
{
|
||||
#region Entity
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
internal static extern void Entity_GetTranslation(UUID entityId, out Vector3 translation);
|
||||
internal static extern void Entity_AddComponent(UUID entityId, Type componentType);
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
internal static extern void Entity_SetTranslation(UUID entityId, in Vector3 translation);
|
||||
internal static extern bool Entity_HasComponent(UUID entityId, Type componentType);
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
internal static extern void Entity_RemoveComponent(UUID entityId, Type componentType);
|
||||
|
||||
#endregion Entity
|
||||
|
||||
#region TransformComponent
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
internal static extern void Transform_GetTranslation(UUID entityId, out Vector3 translation);
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
internal static extern void Transform_SetTranslation(UUID entityId, in Vector3 translation);
|
||||
|
||||
#endregion TransformComponent
|
||||
|
||||
#region RigidBody2D
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
internal static extern void RigidBody2D_ApplyForce(UUID entityId, in Vector2 force, Vector2 point, bool wakeUp);
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
internal static extern void RigidBody2D_ApplyForceToCenter(UUID entityId, in Vector2 force, bool wakeUp);
|
||||
|
||||
#endregion RigidBody2D
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user