Sign In Register

How can we help you today?

Start a new topic

listvirtualgoodsrequest c# example not compiling

the c# example on listvirtualgoodsrequest.html doesn't compile in unity.

I've added numerous comments to this docs page, all of them were refused or removed.

I've contacted support about it and they said they were gonna this.

Following code does NOT compile in unity...

 using GameSparks.Api;
    using GameSparks.Api.Requests;
    using GameSparks.Api.Responses;
    new ListVirtualGoodsRequest()
        .Send((response) => {
        GSData scriptData = response.ScriptData; 
        GSEnumerable<var> virtualGoods = response.VirtualGoods; 
but if you change the last line in


GSEnumerable<ListVirtualGoodsResponse._VirtualGood> virtualGoods = response.VirtualGoods;

 Then it does.

I don't know why GameSparks put's uncompiling examples in their docs at first. And second i don't understand why this is not fixed yet or why my comments are removed or refused.

If i'm missing something about it i also like to know about it.

1 person has this problem

Hi Guys, 

I'll pass this onto the documentation team and get the doc page updated.



1 person likes this

I'm new to all this, but I am having the same problem with LeaderboardDataRequest() in Unity. I have cut and pasted the code from the docs and Visual Studio reports: "The contextual keyword 'var' may only appear withing a local variable declaration or or in script code".

How do I fix that?

1 person likes this
Login to post a comment