Sign In Register

How can we help you today?

Start a new topic
Answered

retrievving price of a virtual good in unity

I'm trying to retrieve (in unity) the price of several virtual goods i created.


This is ,i'm sure, a simple thing if you know how to do this but the examples on the ListVirtualGoodsRequest page doesn't make me much wiser.


The line:

 GSEnumerable<var> virtualGoods = response.VirtualGoods; 

isn't even accept by Unity, i'm sure i'm missing something basic here.





Best Answer

 Hey Ward,

Try this....


 

GSEnumerable<GameSparks.Api.Responses.ListVirtualGoodsResponse._VirtualGood> vgsList = response.VirtualGoods;
                foreach(GameSparks.Api.Responses.ListVirtualGoodsResponse._VirtualGood vg  in vgsList)
                {
                    int cost = vg.Currency1Cost;
                }

 
Thanks,
Sean


Answer

 Hey Ward,

Try this....


 

GSEnumerable<GameSparks.Api.Responses.ListVirtualGoodsResponse._VirtualGood> vgsList = response.VirtualGoods;
                foreach(GameSparks.Api.Responses.ListVirtualGoodsResponse._VirtualGood vg  in vgsList)
                {
                    int cost = vg.Currency1Cost;
                }

 
Thanks,
Sean

Thanks Sean,

I had it working since yesterday but i appreciate the follow-up ;)

 

Login to post a comment