mirror of
https://github.com/godotengine/godot.git
synced 2025-01-24 21:01:50 +08:00
Merge pull request #26776 from neikeq/issue-26616
Fix CSharpInstance::set not working with base classes
This commit is contained in:
commit
488884178e
@ -1315,14 +1315,14 @@ bool CSharpInstance::set(const StringName &p_name, const Variant &p_value) {
|
||||
GDMonoClass *top = script->script_class;
|
||||
|
||||
while (top && top != script->native) {
|
||||
GDMonoField *field = script->script_class->get_field(p_name);
|
||||
GDMonoField *field = top->get_field(p_name);
|
||||
|
||||
if (field) {
|
||||
field->set_value_from_variant(mono_object, p_value);
|
||||
return true;
|
||||
}
|
||||
|
||||
GDMonoProperty *property = script->script_class->get_property(p_name);
|
||||
GDMonoProperty *property = top->get_property(p_name);
|
||||
|
||||
if (property) {
|
||||
property->set_value(mono_object, GDMonoMarshal::variant_to_mono_object(p_value, property->get_type()));
|
||||
|
Loading…
Reference in New Issue
Block a user