mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 13:01:52 +00:00
ScriptCore: Added UUID.CreateNew
This commit is contained in:
@@ -468,6 +468,12 @@ static class ScriptGlue
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
[RegisterCall("ScriptGlue::UUID_CreateNew")]
|
||||
static void UUID_Create(out UUID id)
|
||||
{
|
||||
id = UUID.Create();
|
||||
}
|
||||
|
||||
#region Editor Stuff
|
||||
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
namespace GlitchyEngine.Core;
|
||||
|
||||
public class Application
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns true when the script is running in edit mode.
|
||||
/// </summary>
|
||||
/// <seealso cref="IsPlaying"/>
|
||||
public bool IsEditor = false;
|
||||
/// <summary>
|
||||
/// Returns true when the script is running in play mode or in the player.
|
||||
/// </summary>
|
||||
/// <seealso cref="IsEditor"/>
|
||||
public bool IsPlaying = false;
|
||||
}
|
||||
@@ -14,6 +14,12 @@ public struct UUID
|
||||
|
||||
public static UUID Zero = new UUID(0);
|
||||
|
||||
public static UUID CreateNew()
|
||||
{
|
||||
ScriptGlue.UUID_CreateNew(out UUID id);
|
||||
return id;
|
||||
}
|
||||
|
||||
public static bool operator ==(UUID left, UUID right) => left._uuid == right._uuid;
|
||||
|
||||
public static bool operator !=(UUID left, UUID right) => left._uuid != right._uuid;
|
||||
|
||||
@@ -115,5 +115,19 @@ internal static class ScriptGlue
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
internal static extern float4 modf_float4(float4 x, out float4 integerPart);
|
||||
|
||||
#endregion
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
internal static extern void UUID_CreateNew(out UUID uuid);
|
||||
|
||||
#region Application
|
||||
|
||||
// TODO: Implement IsEditor and IsPlaying
|
||||
//[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
//internal static extern bool Application_IsEditor();
|
||||
|
||||
//[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
//internal static extern bool Application_IsPlaying();
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user