|
|
@ -17,7 +17,9 @@ public unsafe struct World |
|
|
|
public World(ecs_world_t* handle) |
|
|
|
public World(ecs_world_t* handle) |
|
|
|
=> Handle = handle; |
|
|
|
=> Handle = handle; |
|
|
|
|
|
|
|
|
|
|
|
public World(params string[] args) |
|
|
|
/// <summary> Initializes a new Flecs world. </summary> |
|
|
|
|
|
|
|
/// <param name="minimal"> If true, doesn't automatically import built-in modules. </param> |
|
|
|
|
|
|
|
public World(bool minimal = false) |
|
|
|
{ |
|
|
|
{ |
|
|
|
[UnmanagedCallersOnly] |
|
|
|
[UnmanagedCallersOnly] |
|
|
|
static void Abort() => throw new FlecsAbortException(); |
|
|
|
static void Abort() => throw new FlecsAbortException(); |
|
|
@ -27,14 +29,7 @@ public unsafe struct World |
|
|
|
api.abort_ = new FnPtr_Void { Pointer = &Abort }; |
|
|
|
api.abort_ = new FnPtr_Void { Pointer = &Abort }; |
|
|
|
ecs_os_set_api(&api); |
|
|
|
ecs_os_set_api(&api); |
|
|
|
|
|
|
|
|
|
|
|
if (args?.Length > 0) { |
|
|
|
Handle = minimal ? ecs_mini() : ecs_init(); |
|
|
|
var ptr = Runtime.CStrings.CStringArray(args); |
|
|
|
|
|
|
|
Handle = ecs_init_w_args(args.Length, ptr); |
|
|
|
|
|
|
|
for (var i = 0; i < args.Length; i++) |
|
|
|
|
|
|
|
Marshal.FreeHGlobal(ptr[i]); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
Handle = ecs_init(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public bool Progress(TimeSpan delta) |
|
|
|
public bool Progress(TimeSpan delta) |
|
|
|