https://metaplay.io logo
Deserialize a dictionary from sheets.
# questions-and-feedback
j
Hi, how can I input the data in the google sheets so later it can get serialized/deserialized?
I didn't find any docs about dictionaries in the google sheets.
j
A GameConfigLibrary is effectively a dictionary already. If you want to define a dictionary within an item, I'd suggest using a SourceTransform. You can do so by adding the
GameConfigEntryTransform
to the library, e.g.
Copy code
cs
        [GameConfigEntry("SpecialProducerEvents", configBuildSource: nameof(IdlerGameConfigBuildParameters.LiveOpsSource))]
        [GameConfigEntryTransform(typeof(SpecialProducerEventSourceConfigItem))]
        public GameConfigLibrary<SpecialProducerEventId, SpecialProducerEventInfo>  SpecialProducerEvents   { get; private set; }
Then define
SpecialProducerEventSourceConfigItem
, inherit from
IGameConfigSourceItem<SpecialProducerEventId, SpecialProducerEventInfo>
, and implement
ToConfigData
which then returns the final item stored in the game config. The Idler sample has the above example and is a good reference to check for this, if you no longer have the sample, you can re-download the SDK from the Metaplay Portal, which will include our samples.
j
Thanks! 😄