Sign In Register

How can we help you today?

Start a new topic
Answered

Using downloadables in unity

I am relatively new to gamesparks and I am trying to figure out how to use downloadables. The documentation doesn't seem to be helping me in how to implement downloadable using the unity sdk. I just want to know how to download a file onto my application in general and I cannot figure it out right now. Any help would be appreciated. Thank you.

Best Answer

Hi Marc 


Once you have your downloadable set up in the GameSparks portal.

You can use a getDownloadablerequest to get a URL for the downloadable 

In Unity the code for this is

 

using GameSparks.Api;

using GameSparks.Api.Requests;

using GameSparks.Api.Responses;


new GetDownloadableRequest()

   .SetShortCode(shortCode)

   .Send((response) => {

      DateTime? lastModified = response.LastModified; 

      GSData scriptData = response.ScriptData; 

      string shortCode = response.ShortCode; 

      var size = response.Size; 

      string url = response.Url; 

   }); 


In Unity you can use WWW to get the file and then save it.


Regards

Katie

1 Comment

Answer

Hi Marc 


Once you have your downloadable set up in the GameSparks portal.

You can use a getDownloadablerequest to get a URL for the downloadable 

In Unity the code for this is

 

using GameSparks.Api;

using GameSparks.Api.Requests;

using GameSparks.Api.Responses;


new GetDownloadableRequest()

   .SetShortCode(shortCode)

   .Send((response) => {

      DateTime? lastModified = response.LastModified; 

      GSData scriptData = response.ScriptData; 

      string shortCode = response.ShortCode; 

      var size = response.Size; 

      string url = response.Url; 

   }); 


In Unity you can use WWW to get the file and then save it.


Regards

Katie


1 person likes this
Login to post a comment