Exemple #1
0
    public static void requestProducts(List <Purchasable> purchasables)
    {
        if (!isIAPInitComplete())
        {
            return;
        }
#if UNITY_ANDROID && !UNITY_EDITOR
        JSONArray jsonArray = new JSONArray();
        int       index     = 0;
        foreach (Purchasable purchasable in purchasables)
        {
            jsonArray.put(index, purchasable.productId);
            ++index;
        }
        OuyaUnityPlugin.requestProducts(jsonArray.toString());
        jsonArray.Dispose();
#endif
    }
    /// <summary>
    /// Get localized string resource
    /// </summary>
    public static string getStringResource(string key)
    {
        if (!isIAPInitComplete())
        {
            return(string.Empty);
        }
#if UNITY_ANDROID && !UNITY_EDITOR
        if (m_stringResources.ContainsKey(key))
        {
            return(m_stringResources[key]);
        }
        string val = OuyaUnityPlugin.getStringResource(key);
        m_stringResources.Add(key, val);
        return(val);
#else
        return(string.Empty);
#endif
    }
 public void ContentPublishedSearchListenerOnResults(string jsonData)
 {
     using (JSONObject jsonObject = new JSONObject(jsonData))
     {
         int count = 0;
         if (jsonObject.has("count"))
         {
             count = jsonObject.getInt("count");
         }
         List <OuyaMod> ouyaMods = OuyaUnityPlugin.getOuyaContentPublishedResults();
         foreach (OuyaSDK.IContentPublishedSearchListener listener in OuyaSDK.getContentPublishedSearchListeners())
         {
             if (null != listener)
             {
                 listener.ContentPublishedSearchOnResults(ouyaMods, count);
             }
         }
     }
 }
Exemple #4
0
    void RunSearch()
    {
        m_status = "Refreshing list...";

        CleanWidgets();
        ResetFocus();

        using (OuyaContent ouyaContent = OuyaUnityPlugin.getOuyaContent())
        {
            if (null == ouyaContent)
            {
                Debug.LogError("OuyaContent is null");
                return;
            }
            if (ouyaContent.isInitialized())
            {
                OuyaUnityPlugin.getOuyaContentInstalled();
                OuyaUnityPlugin.getOuyaContentPublished(m_sortMethod);
            }
        }
    }
Exemple #5
0
    /// <summary>
    /// Initialized by OuyaGameObject
    /// </summary>
    public static void initOuyaPlugin(string jsonData)
    {
#if UNITY_ANDROID && !UNITY_EDITOR
        OuyaUnityPlugin.initOuyaPlugin(jsonData);
#endif
    }
Exemple #6
0
 void Download(OuyaMod ouyaMod)
 {
     OuyaUnityPlugin.contentDownload(ouyaMod);
 }
Exemple #7
0
 void Delete(OuyaMod ouyaMod)
 {
     OuyaUnityPlugin.contentDelete(ouyaMod);
 }
Exemple #8
0
 void Unpublish(OuyaMod ouyaMod)
 {
     OuyaUnityPlugin.contentUnpublish(ouyaMod);
 }
Exemple #9
0
 void Publish(OuyaMod ouyaMod)
 {
     OuyaUnityPlugin.contentPublish(ouyaMod);
 }
Exemple #10
0
    public static void requestReceiptList()
    {
#if UNITY_ANDROID && !UNITY_EDITOR
        OuyaUnityPlugin.getReceiptsAsync();
#endif
    }
Exemple #11
0
    public static void requestPurchase(Purchasable purchasable)
    {
#if UNITY_ANDROID && !UNITY_EDITOR
        OuyaUnityPlugin.requestPurchaseAsync(purchasable.productId);
#endif
    }
Exemple #12
0
    public static void putGameData(string key, string val)
    {
#if UNITY_ANDROID && !UNITY_EDITOR
        OuyaUnityPlugin.putGameData(key, val);
#endif
    }
Exemple #13
0
    public static void fetchGamerInfo()
    {
#if UNITY_ANDROID && !UNITY_EDITOR
        OuyaUnityPlugin.fetchGamerInfo();
#endif
    }