Skip to content

Latest commit

History

17 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

GData

This is google sheets to class mapper

publicclassGameDataAsset{[GTable("ENEMIES")]// this can be ommited if GTable attribute is present of Enemy classpublicEnemy[]enemies;}
[GTable("ENEMIES")]publicclassEnemy{[GColumn("NAME")]publicstringName;// This will be mapped by Enemy->Loot column using Loot's Index field[GColumn("LOOT")]publicLootLoot;}
[GTable("LOOT")]publicclassLoot{[GColumn("NAME"),GIndex]publicstringName;// GConverter used for defining field-level converters. It also can be defined on Rarity Class[GColumn("RARITY"),GConverter(typeof(RarityConverter))]publicRarityRarity;}publicclassRarityConverter:IConverter<Rarity>{RarityConvert(stringvalue){returnnewRarity(value);}}
DataSourceds=newDataSource("...",// api key (create here: https://console.developers.google.com/apis/credentials)"..."// spreadsheet id);EntityLoaderloader=newEntityLoader(ds);GameDataAssetasset=loader.Load(typeof(GameDataAsset));// Recursively loads fields List<Enemy>enemies=loader.Load(typeof(Enemy));// Loads all entities by classGameDataAssetinstance=newGameDataAsset();loader.LoadToInstance(instance);// Loading to existing instance

About

Google Sheets to C# classes mapping library

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages