首页 > 解决方案 > 应用内购买不使用 Google Play 服务

问题描述

我计划将我的游戏上传到我的个人网站,并且不想使用 Google Play 或其他托管网站。在托管站点之外,我完全没有经验。我知道如何使用 GooglePlay 为应用内购买创建 itemID,但是,如果没有这些,我将如何进行交易?我找不到有关要采取的步骤的任何信息。

我需要知道的:

  1. 如何将交易链接到我的帐户(PayPal 或支票)。
  2. 如何相应地奖励玩家(我更喜欢使用单例模式)。

我的设置:

  1. 我有一个带有按钮的暂停菜单来打开商店菜单。
  2. 我的物品显示在每个物品旁边都有一个“购买”按钮。
  3. “购买”按钮具有与每个公共静态函数相关的 OnClickEvent()。

    // public class InAppPurchase
    
    public static InAppPurchase inst;
    private void Awake()
    {
     if(instance != null)
    {
        Destroy(gameObject);
    }
    else
    {
        instance = this;
        DontDestroyOnLoad(gameObject);
    }
     }// End of Awake()
    public static void BuyAdFreeVersion()
     {
        // Need to know how to charge the client here
        // Don't know any code that doesn't require GooglePlay ID
        // How does this work exactly?
     }
    
    
     // public class InAppButtons
    
     public void RemoveAdsButton() // This will be added to the button itself
     {
         InAppPurchase.inst.BuyAdFreeVersion();
     }
    

标签: c#unity3din-app-purchase

解决方案


推荐阅读