mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 21:01:52 +00:00
Show Buttons in entity editor
- ScriptEngine: Added HasCustomAttribute- extension method - ScriptEngine: Added Application class
This commit is contained in:
@@ -112,7 +112,69 @@ static class ScriptEngine
|
||||
internal static MonoClass* s_ShowInEditorAttribute;
|
||||
internal static MonoClass* s_RunInEditModeAttribute;
|
||||
}
|
||||
|
||||
|
||||
public class ApplicationData
|
||||
{
|
||||
private bool _isEditor;
|
||||
private bool _isPlayer;
|
||||
|
||||
private bool _isInEditMode;
|
||||
private bool _isInPlayMode;
|
||||
|
||||
public bool IsEditor
|
||||
{
|
||||
get => _isEditor;
|
||||
set
|
||||
{
|
||||
_isEditor = value;
|
||||
|
||||
if (_isEditor)
|
||||
_isPlayer = false;
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsPlayer
|
||||
{
|
||||
get => _isPlayer;
|
||||
set
|
||||
{
|
||||
_isPlayer = value;
|
||||
|
||||
if (_isPlayer)
|
||||
_isEditor = false;
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsInEditMode
|
||||
{
|
||||
get => _isInEditMode;
|
||||
set
|
||||
{
|
||||
_isInEditMode = value;
|
||||
|
||||
if (_isInEditMode)
|
||||
_isInPlayMode = false;
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsInPlayMode
|
||||
{
|
||||
get => _isInPlayMode;
|
||||
set
|
||||
{
|
||||
_isInPlayMode = value;
|
||||
|
||||
if (_isInPlayMode)
|
||||
_isInEditMode = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static ApplicationData _applicationData = new ApplicationData() ~ delete _;
|
||||
|
||||
/// Contains information about the application context
|
||||
public static ApplicationData ApplicationInfo => _applicationData;
|
||||
|
||||
public static void Init()
|
||||
{
|
||||
InitMono();
|
||||
|
||||
@@ -475,9 +475,31 @@ static class ScriptGlue
|
||||
id = UUID.Create();
|
||||
}
|
||||
|
||||
#region Editor Stuff
|
||||
#region Application
|
||||
|
||||
[RegisterCall("ScriptGlue::Application_IsEditor")]
|
||||
static bool Application_IsEditor()
|
||||
{
|
||||
return ScriptEngine.ApplicationInfo.IsEditor;
|
||||
}
|
||||
|
||||
[RegisterCall("ScriptGlue::Application_IsPlayer")]
|
||||
static bool Application_IsPlayer()
|
||||
{
|
||||
return ScriptEngine.ApplicationInfo.IsPlayer;
|
||||
}
|
||||
|
||||
[RegisterCall("ScriptGlue::Application_IsInEditMode")]
|
||||
static bool Application_IsInEditMode()
|
||||
{
|
||||
return ScriptEngine.ApplicationInfo.IsInEditMode;
|
||||
}
|
||||
|
||||
[RegisterCall("ScriptGlue::Application_IsInPlayMode")]
|
||||
static bool Application_IsInPlayMode()
|
||||
{
|
||||
return ScriptEngine.ApplicationInfo.IsInPlayMode;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -202,14 +202,6 @@ namespace GlitchyEngine.World
|
||||
}
|
||||
}
|
||||
|
||||
public void Start(bool simulation, bool runtime)
|
||||
{
|
||||
if (simulation)
|
||||
StartSimulation();
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void StartRuntime()
|
||||
{
|
||||
ScriptEngine.StartRuntime(this);
|
||||
|
||||
Reference in New Issue
Block a user