我想检测我的游戏是否处于试用模式并让用户去市场购买。
我编写的代码是 HERE
虽然他们提供的代码样本不起作用
if (Guide.IsTrialMode)
{
Guide.ShowMarketplace(signedInGamer.PlayerIndex);
}
它给出 The name SignedInGamer doesn't exist in the current context
我试着玩了一下并将其修改为:
if (Guide.IsTrialMode)
{
//Guide.ShowMarketplace(signedInGamer.PlayerIndex);
Guide.ShowMarketplace(PlayerIndex.One);
}
它现在可以工作,但在模拟器上它进入市场并提供:
我不确定是因为游戏处于 Debug模式还没有发布,还是因为我做了修改?!
最佳答案
这是因为它还没有在市场上发布。您链接到的页面有此注释:
When the method Guide.ShowMarketplace is called on an application that has not yet been published to the Windows Phone Marketplace, it will result in an error being displayed. If this error has the error code 805a0194, then the call was successful and will operate correctly when the application is published. When your application is published, the Guide.ShowMarketplace will automatically detect your application’s unique ID and launch the correct details page in the Windows Phone Marketplace client application.
关于c# - 使用 XNA 游戏以试用模式进入 Marketplace,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8824754/