I want to find fields of specified type and change their values. For finding its fields, I use this piece of code:
propertyType.GetFields(BindingFlags.Public | BindingFlags.Instance);
And for Setting and getting their values I should use these functions:
FieldInfo.GetValue and FieldInfo.SetValue. As you know they need instance as an input. So I should first create a instance of that type and assign it to these functions.
The problem is as I know and understand the instance should be created once because of not losing values if I'm right but I can't serialized that instance because its type is System.Object and Unity can't serialize it.
Do I do it wrong ? I miss anything between ?