You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
[.Net] Avoid StringName allocations if type does not defines _Get or _Set
This commit is contained in:
@@ -59,6 +59,11 @@ namespace Godot.Bridge
|
|||||||
return godot_bool.True;
|
return godot_bool.True;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!godotObject.HasGodotClassMethod(GodotObject.MethodName._Set.NativeValue.DangerousSelfRef))
|
||||||
|
{
|
||||||
|
return godot_bool.False;
|
||||||
|
}
|
||||||
|
|
||||||
var nameManaged = StringName.CreateTakingOwnershipOfDisposableValue(
|
var nameManaged = StringName.CreateTakingOwnershipOfDisposableValue(
|
||||||
NativeFuncs.godotsharp_string_name_new_copy(CustomUnsafe.AsRef(name)));
|
NativeFuncs.godotsharp_string_name_new_copy(CustomUnsafe.AsRef(name)));
|
||||||
|
|
||||||
@@ -107,6 +112,11 @@ namespace Godot.Bridge
|
|||||||
return godot_bool.True;
|
return godot_bool.True;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!godotObject.HasGodotClassMethod(GodotObject.MethodName._Get.NativeValue.DangerousSelfRef))
|
||||||
|
{
|
||||||
|
return godot_bool.False;
|
||||||
|
}
|
||||||
|
|
||||||
var nameManaged = StringName.CreateTakingOwnershipOfDisposableValue(
|
var nameManaged = StringName.CreateTakingOwnershipOfDisposableValue(
|
||||||
NativeFuncs.godotsharp_string_name_new_copy(CustomUnsafe.AsRef(name)));
|
NativeFuncs.godotsharp_string_name_new_copy(CustomUnsafe.AsRef(name)));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user