|
|
|
@ -4,7 +4,7 @@ using System.Collections.Generic; |
|
|
|
using System.Runtime.InteropServices; |
|
|
|
using UnityEngine; |
|
|
|
|
|
|
|
public class Uniquake: MonoBehaviour |
|
|
|
public class UniQuake: MonoBehaviour |
|
|
|
{ |
|
|
|
private const string DllName = "uniquake.dll"; |
|
|
|
private const int MemSize = 0x4000000; // 64 MB of heap space
|
|
|
|
@ -43,12 +43,12 @@ public class Uniquake: MonoBehaviour |
|
|
|
memSize = MemSize, |
|
|
|
}; |
|
|
|
|
|
|
|
Uniquake_Init(callbacks.CallbacksPtr, quakeParms); |
|
|
|
UniQuake_Init(callbacks.CallbacksPtr, quakeParms); |
|
|
|
} |
|
|
|
|
|
|
|
void Update() |
|
|
|
{ |
|
|
|
Uniquake_Update(Time.deltaTime); |
|
|
|
UniQuake_Update(Time.deltaTime); |
|
|
|
} |
|
|
|
|
|
|
|
private void OnDestroy() |
|
|
|
@ -78,13 +78,13 @@ public class Uniquake: MonoBehaviour |
|
|
|
} |
|
|
|
|
|
|
|
[DllImport(DllName, CallingConvention = CallingConvention.Cdecl)] |
|
|
|
private static extern void Uniquake_Echo(DebugLogCallback logCallback, [MarshalAs(UnmanagedType.LPStr)] string message); |
|
|
|
private static extern void UniQuake_Echo(DebugLogCallback logCallback, [MarshalAs(UnmanagedType.LPStr)] string message); |
|
|
|
|
|
|
|
[DllImport(DllName, CallingConvention = CallingConvention.Cdecl)] |
|
|
|
private static extern void Uniquake_Init(IntPtr callbacks, QuakeParms parms); |
|
|
|
private static extern void UniQuake_Init(IntPtr callbacks, QuakeParms parms); |
|
|
|
|
|
|
|
[DllImport(DllName, CallingConvention = CallingConvention.Cdecl)] |
|
|
|
private static extern void Uniquake_Update(float deltaTime); |
|
|
|
private static extern void UniQuake_Update(float deltaTime); |
|
|
|
|
|
|
|
private delegate void DebugLogCallback([MarshalAs(UnmanagedType.LPStr)] string message); |
|
|
|
|