mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-06 05:01:53 +00:00
Added EditorFlags: Hide entities in hierarchy and editor scene
- Also some Style changes
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
using GlitchyEngine.Editor;
|
||||
namespace GlitchyEngine.World.Components;
|
||||
|
||||
struct EditorFlagsComponent
|
||||
{
|
||||
public EditorFlags Flags;
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using GlitchyEngine.Core;
|
||||
using GlitchyEngine.Editor;
|
||||
using GlitchyEngine.World.Components;
|
||||
|
||||
using internal GlitchyEngine.World;
|
||||
|
||||
@@ -74,6 +76,22 @@ namespace GlitchyEngine.World
|
||||
|
||||
public TransformComponent* Transform => GetComponent<TransformComponent>();
|
||||
|
||||
public EditorFlags EditorFlags
|
||||
{
|
||||
get
|
||||
{
|
||||
if (TryGetComponent<EditorFlagsComponent>(let flagsComponent))
|
||||
return flagsComponent.Flags;
|
||||
|
||||
return .Default;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (TryGetComponent<EditorFlagsComponent>(let flagsComponent))
|
||||
flagsComponent.Flags = value;
|
||||
}
|
||||
}
|
||||
|
||||
public T* AddComponent<T>(T value = T()) where T: struct, new
|
||||
{
|
||||
Log.EngineLogger.AssertDebug(!HasComponent<T>(), scope $"Entity already has component.");
|
||||
|
||||
Reference in New Issue
Block a user