fixed GameObject initialization
This commit is contained in:
parent
5c247ce032
commit
51259e72fe
@ -26,15 +26,15 @@ public class GameObject
|
||||
public Transform Transform { get; }
|
||||
public GameObject? Parent;
|
||||
|
||||
public Dictionary<Type, Component> Components = new();
|
||||
public Dictionary<Type, Component> Components;
|
||||
|
||||
private GameObject(ulong id, uint nativePoolIndex)
|
||||
{
|
||||
_id = id;
|
||||
_index = nativePoolIndex;
|
||||
// constructor doesn't work without writing to console
|
||||
// TODO: FIX THIS BULLSHIT
|
||||
Console.WriteLine($"GameObject(id: {id}, nativePoolIndex: {nativePoolIndex})");
|
||||
// Do not move this line or mono runtime will throw SEGFAULT.
|
||||
// Mono runtime can't set values in field declaration, but initializing everything in constructor is OK.
|
||||
Components = new();
|
||||
}
|
||||
|
||||
static public GameObject Create()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user