mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 21:01:52 +00:00
Added DebugNameComponent
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
namespace GlitchyEngine.World
|
||||
{
|
||||
struct DebugNameComponent : IDisposableComponent
|
||||
{
|
||||
private String _debugName;
|
||||
|
||||
public String DebugName
|
||||
{
|
||||
get => _debugName;
|
||||
set mut => SetName(value);
|
||||
}
|
||||
|
||||
public void SetName(StringView name) mut
|
||||
{
|
||||
delete _debugName;
|
||||
|
||||
_debugName = new String(name);
|
||||
}
|
||||
|
||||
public static void DisposeComponent(void* component)
|
||||
{
|
||||
Self* self = (Self*)component;
|
||||
|
||||
DeleteAndNullify!(self._debugName);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user