fixed GameObject initialization

This commit is contained in:
Timerix 2025-04-21 21:19:17 +05:00
parent 5c247ce032
commit 51259e72fe

View File

@ -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()