public static T CreateComponent <T>() where T : Component { ulong id = IdPool.Get(); T component = Activator.CreateInstance <T>(); component.Id = id; // add component to Engine components[id] = component; return(component); }
public static GameObject CreateGameObject() { ulong id = IdPool.Get(); GameObject @object = new GameObject(); @object.Id = id; // add object to Engine objects[id] = @object; return(@object); }