首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在应用计费插件Unity android中使用prime31添加购买动作

如何在应用计费插件Unity android中使用prime31添加购买动作
EN

Stack Overflow用户
提问于 2014-09-22 19:16:54
回答 1查看 838关注 0票数 1

我有个大问题。我得到了插件的工作,我可以测试购买我的项目。但我在脚本中找不到可以在购买商品时添加动作的地方。我有3个项目,分别命名为"item60“、"item70”和"item80“。有谁能帮帮我吗?

EN

回答 1

Stack Overflow用户

发布于 2014-09-23 06:15:48

我使用prime31并在此方法中处理操作,以下是我的remove ads购买

代码语言:javascript
复制
    void purchaseSucceededEvent( GooglePurchase purchase )
        {
            Debug.Log( "purchaseSucceededEvent: " + purchase );

            if(purchase.purchaseState == GooglePurchase.GooglePurchaseState.Purchased){
            if(purchase.productId == "jacs.apps.adds")
                {
                    Debug.Log("inside jacs.apps.adds");
                    if(PlayerPrefs.HasKey("plus"))
                        {
                        adds = false;
                            PlayerPrefs.SetString("addskey","true");



                        }else{
                        PlayerPrefs.SetString("plus","on");

                        adds = false;
                            PlayerPrefs.SetString("addskey","true");

                                }

                    GoogleIAB.consumeProduct( "jacs.apps.adds" );
                }
    }
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/25972789

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档