Merge pull request #53577 from raulsntos/fix-mono-to-variant-array-3.x
This commit is contained in:
commit
5ff8d0e8a7
2 changed files with 28 additions and 0 deletions
|
@ -281,6 +281,16 @@ void GDMonoField::set_value_from_variant(MonoObject *p_object, const Variant &p_
|
|||
break;
|
||||
}
|
||||
|
||||
if (array_type->eklass == CACHED_CLASS_RAW(NodePath)) {
|
||||
SET_FROM_ARRAY(Array);
|
||||
break;
|
||||
}
|
||||
|
||||
if (array_type->eklass == CACHED_CLASS_RAW(RID)) {
|
||||
SET_FROM_ARRAY(Array);
|
||||
break;
|
||||
}
|
||||
|
||||
GDMonoClass *array_type_class = GDMono::get_singleton()->get_class(array_type->eklass);
|
||||
if (CACHED_CLASS(GodotObject)->is_assignable_from(array_type_class)) {
|
||||
MonoArray *managed = GDMonoMarshal::Array_to_mono_array(p_value.operator ::Array(), array_type_class);
|
||||
|
|
|
@ -133,6 +133,12 @@ Variant::Type managed_to_variant_type(const ManagedType &p_type) {
|
|||
if (array_type->eklass == CACHED_CLASS_RAW(Color))
|
||||
return Variant::POOL_COLOR_ARRAY;
|
||||
|
||||
if (array_type->eklass == CACHED_CLASS_RAW(NodePath))
|
||||
return Variant::ARRAY;
|
||||
|
||||
if (array_type->eklass == CACHED_CLASS_RAW(RID))
|
||||
return Variant::ARRAY;
|
||||
|
||||
GDMonoClass *array_type_class = GDMono::get_singleton()->get_class(array_type->eklass);
|
||||
if (CACHED_CLASS(GodotObject)->is_assignable_from(array_type_class))
|
||||
return Variant::ARRAY;
|
||||
|
@ -511,6 +517,12 @@ MonoObject *variant_to_mono_object(const Variant *p_var, const ManagedType &p_ty
|
|||
if (array_type->eklass == CACHED_CLASS_RAW(Color))
|
||||
return (MonoObject *)PoolColorArray_to_mono_array(p_var->operator PoolColorArray());
|
||||
|
||||
if (array_type->eklass == CACHED_CLASS_RAW(NodePath))
|
||||
return (MonoObject *)Array_to_mono_array(p_var->operator Array());
|
||||
|
||||
if (array_type->eklass == CACHED_CLASS_RAW(RID))
|
||||
return (MonoObject *)Array_to_mono_array(p_var->operator Array());
|
||||
|
||||
GDMonoClass *array_type_class = GDMono::get_singleton()->get_class(array_type->eklass);
|
||||
if (CACHED_CLASS(GodotObject)->is_assignable_from(array_type_class))
|
||||
return (MonoObject *)Array_to_mono_array(p_var->operator Array(), array_type_class);
|
||||
|
@ -794,6 +806,12 @@ Variant mono_object_to_variant_impl(MonoObject *p_obj, const ManagedType &p_type
|
|||
if (array_type->eklass == CACHED_CLASS_RAW(Color))
|
||||
return mono_array_to_PoolColorArray((MonoArray *)p_obj);
|
||||
|
||||
if (array_type->eklass == CACHED_CLASS_RAW(NodePath))
|
||||
return mono_array_to_Array((MonoArray *)p_obj);
|
||||
|
||||
if (array_type->eklass == CACHED_CLASS_RAW(RID))
|
||||
return mono_array_to_Array((MonoArray *)p_obj);
|
||||
|
||||
GDMonoClass *array_type_class = GDMono::get_singleton()->get_class(array_type->eklass);
|
||||
if (CACHED_CLASS(GodotObject)->is_assignable_from(array_type_class))
|
||||
return mono_array_to_Array((MonoArray *)p_obj);
|
||||
|
|
Loading…
Reference in a new issue