// An example object with the data to be sent to the game
PlayerData playerData = new PlayerData();
playerData.PlayerName = "John";
playerData.HiScore = 999;
// Use WebAPI2Construct to transform your data in a Construct readable format
var playerDataJSONDictionary = Construct2Convert.ToDictionary(playerData);
return Ok(playerDataJSONDictionary); // Send the data to the game
Second Pass: Construct
1. When in Construct, use an AJAX object Request URL action to request the data to ASP.NET WEB API project that still runing in Visual Studio, or hosted in a web server.
2. Catch the data in the game using the AJAX On completed event.
3. Use a Dictionary object Load action to load the data from the AJAX.LastData variable.
4. After that you be able to read your data from inside the Dictionary.
Why using Construct Dictionaries?
By using a Dictionary you will be able to send more complex data to the game at the same time.
Learn more at WebAPI2Construct project's website at GitHub