mirror of
https://github.com/godotengine/godot.git
synced 2026-01-05 06:11:29 +03:00
Merge pull request #56300 from raulsntos/fix-37812-3.x
[3.x] Fix getting properties state when reloading C#
This commit is contained in:
@@ -1570,9 +1570,19 @@ void CSharpInstance::get_properties_state_for_reloading(List<Pair<StringName, Va
|
||||
|
||||
ManagedType managedType;
|
||||
|
||||
GDMonoField *field = script->script_class->get_field(state_pair.first);
|
||||
if (!field)
|
||||
GDMonoField *field = nullptr;
|
||||
GDMonoClass *top = script->script_class;
|
||||
while (top && top != script->native) {
|
||||
field = top->get_field(state_pair.first);
|
||||
if (field) {
|
||||
break;
|
||||
}
|
||||
|
||||
top = top->get_parent_class();
|
||||
}
|
||||
if (!field) {
|
||||
continue; // Properties ignored. We get the property baking fields instead.
|
||||
}
|
||||
|
||||
managedType = field->get_type();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user