Exemple #1
0
        public static void GetVirtualGoods(VirtualGoodType type, VirtualGood.GetVirtualGoodArrayFinished callback)
        {
            if (javaUnityApplicasaIAP == null)
            {
                javaUnityApplicasaIAP = new AndroidJavaClass("com.applicasaunity.Unity.ApplicasaIAP");
            }
            Error error;

            error.Id      = 1;
            error.Message = "Success";

            AndroidJavaObject virtualGoodArrayJava = javaUnityApplicasaIAP.CallStatic <AndroidJavaObject>("ApplicasaIAPGetVirtualGoodsOfType", (int)type);

            VirtualGood.VirtualGoodArray virtualGoodArray = new VirtualGood.VirtualGoodArray();

            virtualGoodArray.Array = virtualGoodArrayJava.GetRawObject();
            AndroidJavaObject[] convertedArray = AndroidJNIHelper.ConvertFromJNIArray <AndroidJavaObject[]>(virtualGoodArray.Array);
            int count = 0;

            for (int i = 0; i < convertedArray.Length; i++)
            {
                AndroidJavaObject[] temp = AndroidJNIHelper.ConvertFromJNIArray <AndroidJavaObject[]>(convertedArray[i].GetRawObject());
                count += temp.Length;
            }
            virtualGoodArray.ArraySize = count;
            convertedArray             = null;


            callback(true, error, virtualGoodArray);
        }
Exemple #2
0
 public static void GetVirtualGoods(VirtualGoodType type, VirtualGoodCategory virtualGoodCategory, VirtualGood.GetVirtualGoodArrayFinished callback)
 {
     ApplicasaIAPGetVirtualGoodsOfTypeAndCategory(type, virtualGoodCategory.innerVirtualGoodCategory, callback);
 }
Exemple #3
0
 private static extern void ApplicasaIAPGetVirtualGoodsOfTypeAndCategory(VirtualGoodType type, IntPtr virtualGoodCategory, VirtualGood.GetVirtualGoodArrayFinished callback);
Exemple #4
0
 public static void GetVirtualGoods(VirtualGoodType type, VirtualGood.GetVirtualGoodArrayFinished callback)
 {
     ApplicasaIAPGetVirtualGoodsOfType(type, callback);
 }
Exemple #5
0
 private static extern void ApplicasaIAPGetVirtualGoodsOfType(VirtualGoodType type, VirtualGood.GetVirtualGoodArrayFinished callback);
Exemple #6
0
 public static void GetVirtualGoodsByCategoryPosition(VirtualGoodType type, int position, VirtualGood.GetVirtualGoodArrayFinished callback)
 {
     callback(true, new Error(), new VirtualGood.VirtualGoodArray());
 }
Exemple #7
0
 public static void GetVirtualGoods(VirtualGoodType type, VirtualGoodCategory virtualGoodCategory, VirtualGood.GetVirtualGoodArrayFinished callback)
 {
     callback(true, new Error(), new VirtualGood.VirtualGoodArray());
 }
Exemple #8
0
 public static void GetVirtualGoodsByCategoryPosition(VirtualGoodType type, int position, VirtualGood.GetVirtualGoodArrayFinished callback)
 {
     ApplicasaIAPGetVirtualGoodsByCategoryPosition(type, position, callback);
 }
Exemple #9
0
 private static extern void ApplicasaIAPGetVirtualGoodsByCategoryPosition(VirtualGoodType type, int position, VirtualGood.GetVirtualGoodArrayFinished callback);
        public static void GetVirtualGoodsByCategoryPosition(VirtualGoodType type, int position, VirtualGood.GetVirtualGoodArrayFinished callback)
        {
            if (javaUnityApplicasaVirtualGood == null)
            {
                javaUnityApplicasaVirtualGood = new AndroidJavaClass("com.applicasaunity.Unity.ApplicasaVirtualGood");
            }
            int uniqueActionID = Core.currentCallbackID;

            Core.currentCallbackID++;
            setGetVirtualGoodArrayFinished(callback, uniqueActionID);
            javaUnityApplicasaVirtualGood.CallStatic("ApplicasaVirtualGoodsGetVirtualGoodsByCategoryPosition", (int)type, position, uniqueActionID);
        }