Hey folks,
I've got an issue I can't pinpoint. I'm getting an exception thrown trying to serialize a class I have, but it isn't consistent. If I comment everything out, it's fine...if I let most back in, it may throw the exception, but if I comment one out and another back in, it might still throw that exception. It's not a specific variable it's trying to serialize, but maybe it's a max variable type thing?
The thrown exception is:
Number of parameters specified does not match the expected number.
The code trigger the exception is the line trying to serialize:
string serialized = null; try { serialized = PlayFabSimpleJson.SerializeObject( m_TitleGameplay ); } catch( Exception e ) { DebugManager.Log( e.Message, true ); } finally { DebugManager.Log( ( serialized != null ) ? "Success!" : "Failure" ); }
Finally, the class that's being serialized:
public class TitleGameplay { public int version = 0; public Difficulty[] difficulties; public Perk[] perks; public Town[] towns; public VendorEvent[] vendorEvents; public TravelEvent[] travelEvents; public Ailment[] ailments; public ReputationData reputationData = new ReputationData(); public ShopBundle[] shopBundles; public Component[][] resourcePack; public int adTravelTime = 5000; public int chauffeurTravelTime = 5000; public float banditGoldPercent = 0.2f; public int banditGoldThreshold = 1000; public int horsePurchaseCost = 850; public float vendorMinDensity = 0.2f; public float vendorMaxDensity = 0.4f; public float vendorMinImpact = 0.2f; public float vendorMaxImpact = 0.8f; public int travelMinFrequency = 30; public int travelMaxFrequency = 8; public float travelMinImpact = 0.2f; public float travelMaxImpact = 0.8f; public int maxRepBonusStorage = 10; public int normalVoucherCost = 75; public int premiumVoucherCost = 150; public float duplicateRefundPercent = 0.25f; }
So to be clear, one example was having most things active but a few commented out, it would serialize fine. Then I might uncomment a line (perks was one example, towns was another), making it active again, and it'd failed.
Those classes themselves just have primitive types (or arrays of them).
I appreciate the info, I'm struggling with fixing this problem and it's pretty important right now to get working.
Thanks,
Matt