List Serialization and Editor for Scripts #193

Merged
Pycorax merged 21 commits from SP3-6-ArraySerialization into main 2022-11-13 11:58:06 +08:00
1 changed files with 5 additions and 2 deletions
Showing only changes of commit 26e0e72b25 - Show all commits

View File

@ -212,8 +212,10 @@ namespace SHADE
System::Type^ listType = System::Collections::Generic::List<int>::typeid->GetGenericTypeDefinition()->MakeGenericType(typeList);
// Create a list of the specified type
array<int>^ params = gcnew array<int>{ node.size() };
object = System::Activator::CreateInstance(listType, params);
System::Collections::IList^ list = safe_cast<System::Collections::IList^>(object);
System::Collections::IList^ list = safe_cast<System::Collections::IList^>
(
System::Activator::CreateInstance(listType, params)
);
// Populate the list
for (int i = 0; i < LIST_SIZE; ++i)
@ -227,6 +229,7 @@ namespace SHADE
list->Add(obj);
}
}
fieldInfo->SetValue(object, list);
}
}