mirror of
https://github.com/antopilo/Nuake.git
synced 2026-01-06 06:09:52 +03:00
First pass scriptable subsystems that has the same lifetime of the engine
This commit is contained in:
6
NuakeNet/src/EngineSubsystem.cs
Normal file
6
NuakeNet/src/EngineSubsystem.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace Nuake.Net;
|
||||
|
||||
public class EngineSubsystem
|
||||
{
|
||||
|
||||
}
|
||||
6
NuakeNet/src/EngineTickableSubsystem.cs
Normal file
6
NuakeNet/src/EngineTickableSubsystem.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace Nuake.Net;
|
||||
|
||||
public class EngineTickableSubsystem
|
||||
{
|
||||
|
||||
}
|
||||
@@ -5,6 +5,7 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Numerics;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
@@ -18,6 +19,8 @@ namespace Nuake.Net
|
||||
{
|
||||
internal static unsafe delegate*<NativeString, void> LoggerLogIcall;
|
||||
internal static unsafe delegate*<NativeString, void> LoadSceneIcall;
|
||||
internal static unsafe delegate*<NativeString, NativeInstance<EngineSubsystem>> GetSubsystemByNameIcall;
|
||||
|
||||
public Engine() { }
|
||||
|
||||
public static void LoadScene(string path)
|
||||
@@ -33,6 +36,14 @@ namespace Nuake.Net
|
||||
{
|
||||
unsafe { LoggerLogIcall(input); }
|
||||
}
|
||||
|
||||
public static T? GetSubsystem<T>() where T : EngineSubsystem
|
||||
{
|
||||
unsafe
|
||||
{
|
||||
return (T?)GetSubsystemByNameIcall(typeof(T).FullName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public struct AABB
|
||||
|
||||
Reference in New Issue
Block a user