unity-game-enginegamesparks

Understanding Data Types in Gamesparks


I'm having hard times trying to understand Data Types. Maybe I'm missing something because I feel totally off road in understanding them.

Here are all the questions wandering in my mind:

If all these don't make sense I think I'm more off road than I thought.


Solution

  • About deleting by UI, from GameSpark Documentation:

    You can Drop a Data Type to remove all of its data

    To remove just an item inside a Data Type just open the data type, find the item, click on it, then click on remove (in case of one result) or on the bin icon (in case of multiple results).

    About deleting by cloud code, from GameSpark form, seem like you have to delete the document inside the item:

     var sparkDataGetResult = Spark.getGameDataService().getItem(myDataType, myId);
     var sparkDataItem = sparkDataGetResult.document();
     sparkDataItem.delete();`
    

    You can iterate on a Spark.getGameDataService().queryItems(string type, SparkDataCondition condition) if you need to delete more items at once by cloud code. More here

    About the Data Index, its menu allow you to add indexes only on existing Data Types, so it will create a Data Types before adding an index. More about indexes here