diff --git a/Nuake/src/Scene/Systems/ScriptingSystem.cpp b/Nuake/src/Scene/Systems/ScriptingSystem.cpp index 2363ac89..4a217b2d 100644 --- a/Nuake/src/Scene/Systems/ScriptingSystem.cpp +++ b/Nuake/src/Scene/Systems/ScriptingSystem.cpp @@ -93,7 +93,6 @@ namespace Nuake } } - void ScriptingSystem::FixedUpdate(Timestep ts) { if (!Engine::IsPlayMode()) @@ -123,7 +122,6 @@ namespace Nuake } } - void ScriptingSystem::Exit() { auto entities = m_Scene->m_Registry.view(); diff --git a/NuakeNet/src/Components.cs b/NuakeNet/src/Components.cs index 6578f433..73f82568 100644 --- a/NuakeNet/src/Components.cs +++ b/NuakeNet/src/Components.cs @@ -1,4 +1,5 @@ -using System; +using Coral.Managed.Interop; +using System; using System.Collections.Generic; using System.Drawing; using System.Linq; @@ -102,12 +103,27 @@ namespace Nuake.Net public class CameraComponent : IComponent { + internal static unsafe delegate*> GetDirectionIcall; + public CameraComponent(int entityId) { EntityID = entityId; } public float FOV { get; set; } + + public Vector3 Direction + { + get + { + unsafe + { + NativeArray direction = GetDirectionIcall(EntityID); + return new Vector3(direction[0], direction[1], direction[2]); + } + } + } + } public class AudioEmitterComponent : IComponent @@ -211,6 +227,9 @@ namespace Nuake.Net public class CharacterControllerComponent : IComponent { + internal static unsafe delegate* MoveAndSlideIcall; + internal static unsafe delegate* IsOnGroundIcall; + public CharacterControllerComponent(int entityId) { EntityID = entityId; @@ -218,12 +237,12 @@ namespace Nuake.Net public void MoveAndSlide(Vector3 velocity) { - + unsafe { MoveAndSlideIcall(EntityID, velocity.X, velocity.Y, velocity.Z); } } public bool IsOnGround() { - return false; + unsafe { return IsOnGroundIcall(EntityID); } } }