ScriptCore: Added UUID.CreateNew

This commit is contained in:
Simon Lübeß
2023-12-10 12:50:11 +01:00
parent 1238a43896
commit bedbc696c3
4 changed files with 41 additions and 0 deletions
+15
View File
@@ -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;
}
+6
View File
@@ -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;