mirror of
https://github.com/godotengine/godot
synced 2024-09-04 22:58:28 +00:00
C#: Fix errors when creating Variant from null array
This commit is contained in:
parent
fe01776f05
commit
833a03fbf6
|
@ -235,13 +235,28 @@ namespace Godot.NativeInterop
|
|||
}
|
||||
|
||||
public static godot_variant CreateFromSystemArrayOfStringName(Span<StringName> from)
|
||||
=> CreateFromArray(new Collections.Array(from));
|
||||
{
|
||||
if (from == null)
|
||||
return default;
|
||||
using var fromGodot = new Collections.Array(from);
|
||||
return CreateFromArray((godot_array)fromGodot.NativeValue);
|
||||
}
|
||||
|
||||
public static godot_variant CreateFromSystemArrayOfNodePath(Span<NodePath> from)
|
||||
=> CreateFromArray(new Collections.Array(from));
|
||||
{
|
||||
if (from == null)
|
||||
return default;
|
||||
using var fromGodot = new Collections.Array(from);
|
||||
return CreateFromArray((godot_array)fromGodot.NativeValue);
|
||||
}
|
||||
|
||||
public static godot_variant CreateFromSystemArrayOfRid(Span<Rid> from)
|
||||
=> CreateFromArray(new Collections.Array(from));
|
||||
{
|
||||
if (from == null)
|
||||
return default;
|
||||
using var fromGodot = new Collections.Array(from);
|
||||
return CreateFromArray((godot_array)fromGodot.NativeValue);
|
||||
}
|
||||
|
||||
public static godot_variant CreateFromSystemArrayOfGodotObject(GodotObject[]? from)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue