public static VirtualGood[] GetVirtualGoodArray(VirtualGoodArray virtualGoodArray)
        {
            VirtualGood[] virtualGoods = new VirtualGood[virtualGoodArray.ArraySize];

            for (int i = 0; i < virtualGoodArray.ArraySize; i++)
            {
                IntPtr newPtr = Marshal.ReadIntPtr(virtualGoodArray.Array, i * Marshal.SizeOf(typeof(IntPtr)));
                virtualGoods[i] = new VirtualGood(newPtr);
            }
            return(virtualGoods);
        }
Exemple #2
0
        public static void UseVirtualGood(VirtualGood virtualGood, int quantity, Action action)
        {
            if (javaUnityApplicasaIAP == null)
            {
                javaUnityApplicasaIAP = new AndroidJavaClass("com.applicasaunity.Unity.ApplicasaIAP");
            }
            int uniqueActionID = Core.currentCallbackID;

            Core.currentCallbackID++;
            Core.setActionCallback(action, uniqueActionID);
            javaUnityApplicasaIAP.CallStatic("ApplicasaIAPUseVirtualGood", virtualGood.innerVirtualGoodJavaObject, quantity, uniqueActionID);
        }
Exemple #3
0
 public static void BuyVirtualGood(VirtualGood virtualGood, int quantity, Currency currencyKind, Action action)
 {
     if (currencyKind == Currency.RealMoney)
     {
         BuyWithRealMoney(virtualGood, action);
     }
     else
     {
         if (javaUnityApplicasaIAP == null)
         {
             javaUnityApplicasaIAP = new AndroidJavaClass("com.applicasaunity.Unity.ApplicasaIAP");
         }
         int uniqueActionID = Core.currentCallbackID;
         Core.currentCallbackID++;
         Core.setActionCallback(action, uniqueActionID);
         javaUnityApplicasaIAP.CallStatic("ApplicasaIAPBuyVirtualGood", virtualGood.innerVirtualGoodJavaObject, quantity, (int)currencyKind, uniqueActionID);
     }
 }
        public static VirtualGood[] GetVirtualGoodArray(VirtualGoodArray virtualGoodArray)
        {
            VirtualGood[]       virtualGoodInner = new VirtualGood[virtualGoodArray.ArraySize];
            AndroidJavaObject[] bigArray         = AndroidJNIHelper.ConvertFromJNIArray <AndroidJavaObject[]>(virtualGoodArray.Array);

            int count = 0;

            for (int i = 0; i < bigArray.Length; i++)
            {
                AndroidJavaObject   tempJavaObject = bigArray[i];
                AndroidJavaObject[] InnerArray     = AndroidJNIHelper.ConvertFromJNIArray <AndroidJavaObject[]>(tempJavaObject.GetRawObject());

                for (int j = 0; j < InnerArray.Length; j++)
                {
                    AndroidJavaObject tempObj = InnerArray[j];
                    virtualGoodInner[count] = new VirtualGood(tempObj.GetRawObject(), tempObj);
                    count++;
                }
            }
            return(virtualGoodInner);
        }
Exemple #5
0
 public static void BuyWithRealMoney(VirtualGood virtualGood, Action action)
 {
     virtualGood.BuyWithRealMoney(action);
 }
Exemple #6
0
 public static void UseVirtualGood(VirtualGood virtualGood, int quantity, Action action)
 {
     action(true,new Error(),"",Actions.DoIapAction);
 }
Exemple #7
0
 public static void GetVirtualGoodsByCategoryPosition(VirtualGoodType type, int position, VirtualGood.GetVirtualGoodArrayFinished callback)
 {
     callback(true,new Error(),new VirtualGood.VirtualGoodArray());
 }
Exemple #8
0
 private static extern void ApplicasaIAPGetVirtualGoodsOfType(VirtualGoodType type, VirtualGood.GetVirtualGoodArrayFinished callback);
Exemple #9
0
 public static void UseVirtualGood(VirtualGood virtualGood, int quantity, Action action)
 {
     action(true, new Error(), "", Actions.DoIapAction);
 }
 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);
 }
        public static VirtualGood[] GetVirtualGoodArray(VirtualGoodArray virtualGoodArray)
        {
            VirtualGood[] virtualGoodInner = new VirtualGood[virtualGoodArray.ArraySize];
            AndroidJavaObject[] bigArray = AndroidJNIHelper.ConvertFromJNIArray<AndroidJavaObject[]>(virtualGoodArray.Array);

            int count = 0;
            for (int i = 0;i < bigArray.Length;i++)
            {
                AndroidJavaObject tempJavaObject = bigArray[i];
                AndroidJavaObject[] InnerArray = AndroidJNIHelper.ConvertFromJNIArray<AndroidJavaObject[]>(tempJavaObject.GetRawObject());

                for (int j = 0;j < InnerArray.Length;j++)
                {
                    AndroidJavaObject tempObj = InnerArray[j];
                    virtualGoodInner[count] = new VirtualGood(tempObj.GetRawObject(),tempObj);
                    count++;
                }
            }
            return virtualGoodInner;
        }
 public static VirtualGood[] GetVirtualGoodArray(VirtualGoodArray virtualGoodArray)
 {
     VirtualGood[] virtualGoods = new VirtualGood[0];
     return virtualGoods;
 }
        public static VirtualGood[] GetVirtualGoodArray(VirtualGoodArray virtualGoodArray)
        {
            VirtualGood[] virtualGoods = new VirtualGood[virtualGoodArray.ArraySize];

            for (int i=0; i < virtualGoodArray.ArraySize; i++) {

                IntPtr newPtr = Marshal.ReadIntPtr (virtualGoodArray.Array, i * Marshal.SizeOf(typeof(IntPtr)));
                virtualGoods[i] = new VirtualGood(newPtr);
            }
            return virtualGoods;
        }
Exemple #14
0
 public static void BuyWithRealMoney(VirtualGood virtualGood, Action action)
 {
     ApplicasaIAPBuyWithRealMoney(virtualGood.innerVirtualGood, action);
 }
Exemple #15
0
 public static void BuyVirtualGood(VirtualGood virtualGood, int quantity, Currency currencyKind, Action action)
 {
     ApplicasaIAPBuyVirtualGood(virtualGood.innerVirtualGood, quantity, currencyKind, action);
 }
Exemple #16
0
        public static void GetVirtualGoodsByCategoryPosition(VirtualGoodType type, int position, 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>("ApplicasaIAPGetVirtualGoodsOfTypeByCategoryPosition", position, (int)type);

            VirtualGood.VirtualGoodArray virtualGoodArray;

            virtualGoodArray.ArraySize=virtualGoodArrayJava.Call<int>("size");
            virtualGoodArray.Array=virtualGoodArrayJava.GetRawObject();

            callback(true,error,virtualGoodArray);
        }
Exemple #17
0
 public static void BuyVirtualGood(VirtualGood virtualGood, int quantity, Currency currencyKind, Action action)
 {
     action(true, new Error(), "", Actions.DoIapAction);
 }
Exemple #18
0
 public static void GetVirtualGoods(VirtualGoodType type, VirtualGood.GetVirtualGoodArrayFinished callback)
 {
     ApplicasaIAPGetVirtualGoodsOfType(type, callback);
 }
Exemple #19
0
 public static void UseVirtualGood(VirtualGood virtualGood, int quantity, Action action)
 {
     ApplicasaIAPUseVirtualGood(virtualGood.innerVirtualGood, quantity, action);
 }
Exemple #20
0
 public static void GetVirtualGoods(VirtualGoodType type, VirtualGoodCategory virtualGoodCategory, VirtualGood.GetVirtualGoodArrayFinished callback)
 {
     ApplicasaIAPGetVirtualGoodsOfTypeAndCategory(type, virtualGoodCategory.innerVirtualGoodCategory , callback);
 }
Exemple #21
0
 public static void GetVirtualGoods(VirtualGoodType type, VirtualGoodCategory virtualGoodCategory, VirtualGood.GetVirtualGoodArrayFinished callback)
 {
     callback(true,new Error(),new VirtualGood.VirtualGoodArray());
 }
Exemple #22
0
 public static void GetVirtualGoodsByCategoryPosition(VirtualGoodType type, int position, VirtualGood.GetVirtualGoodArrayFinished callback)
 {
     ApplicasaIAPGetVirtualGoodsByCategoryPosition(type, position , callback);
 }
Exemple #23
0
 private static extern void ApplicasaIAPGetVirtualGoodsOfTypeAndCategory(VirtualGoodType type, IntPtr virtualGoodCategory, VirtualGood.GetVirtualGoodArrayFinished callback);
Exemple #24
0
 public static void UseVirtualGood(VirtualGood virtualGood, int quantity, Action action)
 {
     virtualGood.Use(quantity,action);
 }
Exemple #25
0
 public static void BuyVirtualGood(VirtualGood virtualGood, int quantity, Currency currencyKind, Action action)
 {
     virtualGood.Buy(quantity,currencyKind,action);
 }
Exemple #26
0
 public static void BuyVirtualGood(VirtualGood virtualGood, int quantity, Currency currencyKind, Action action)
 {
     if (currencyKind  == Currency.RealMoney)
     {
         BuyWithRealMoney(virtualGood, action);
     }
     else{
         if(javaUnityApplicasaIAP==null)
             javaUnityApplicasaIAP = new AndroidJavaClass("com.applicasaunity.Unity.ApplicasaIAP");
         int uniqueActionID=Core.currentCallbackID;
         Core.currentCallbackID++;
         Core.setActionCallback(action,uniqueActionID);
         javaUnityApplicasaIAP.CallStatic("ApplicasaIAPBuyVirtualGood", virtualGood.innerVirtualGoodJavaObject, quantity, (int)currencyKind, uniqueActionID);
     }
 }
Exemple #27
0
 public static void BuyWithRealMoney(VirtualGood virtualGood, Action action)
 {
     if(javaUnityApplicasaIAP==null)
         javaUnityApplicasaIAP = new AndroidJavaClass("com.applicasaunity.Unity.ApplicasaIAP");
     int uniqueActionID=Core.currentCallbackID;
     Core.currentCallbackID++;
     Core.setActionCallback(action,uniqueActionID);
     javaUnityApplicasaIAP.CallStatic("ApplicasaIAPBuyWithRealMoney", virtualGood.innerVirtualGoodJavaObject, uniqueActionID);
 }
Exemple #28
0
        public static void GetVirtualGoodsByCategoryPosition(VirtualGoodType type, int position, 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>("ApplicasaIAPGetVirtualGoodsOfTypeByCategoryPosition", position, (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);
        }
 public static VirtualGood[] GetVirtualGoodArray(VirtualGoodArray virtualGoodArray)
 {
     VirtualGood[] virtualGoods = new VirtualGood[0];
     return(virtualGoods);
 }
Exemple #30
0
 public static void UseVirtualGood(VirtualGood virtualGood, int quantity, Action action)
 {
     if(javaUnityApplicasaIAP==null)
         javaUnityApplicasaIAP = new AndroidJavaClass("com.applicasaunity.Unity.ApplicasaIAP");
     int uniqueActionID=Core.currentCallbackID;
     Core.currentCallbackID++;
     Core.setActionCallback(action,uniqueActionID);
     javaUnityApplicasaIAP.CallStatic("ApplicasaIAPUseVirtualGood",virtualGood.innerVirtualGoodJavaObject, quantity, uniqueActionID);
 }
Exemple #31
0
 public static void BuyVirtualGood(VirtualGood virtualGood, int quantity, Currency currencyKind, Action action)
 {
     virtualGood.Buy(quantity, currencyKind, action);
 }
Exemple #32
0
 private static extern void ApplicasaIAPGetVirtualGoodsByCategoryPosition(VirtualGoodType type, int position, VirtualGood.GetVirtualGoodArrayFinished callback);
Exemple #33
0
 public static void BuyWithRealMoney(VirtualGood virtualGood, Action action)
 {
     virtualGood.BuyWithRealMoney(action);
 }
Exemple #34
0
 public static void BuyVirtualGood(VirtualGood virtualGood, int quantity, Currency currencyKind, Action action)
 {
     action(true,new Error(),"",Actions.DoIapAction);
 }
Exemple #35
0
 public static void BuyWithRealMoney(VirtualGood virtualGood, Action action)
 {
     action(true, new Error(), "", Actions.DoIapAction);
 }
Exemple #36
0
 public static void BuyWithRealMoney(VirtualGood virtualGood, Action action)
 {
     action(true,new Error(),"",Actions.DoIapAction);
 }
Exemple #37
0
 public static void UseVirtualGood(VirtualGood virtualGood, int quantity, Action action)
 {
     virtualGood.Use(quantity, action);
 }
        public static VirtualGood[] GetVirtualGoodArray(VirtualGoodArray virtualGoodArray)
        {
            VirtualGood[] virtualGoods = new VirtualGood[virtualGoodArray.ArraySize];

            #if UNITY_ANDROID
            AndroidJavaObject tempJavaObjectArray=new AndroidJavaObject(virtualGoodArray.Array);
            #endif
            for (int i = 0; i < virtualGoodArray.ArraySize; i++)
            {
            #if UNITY_IPHONE
                IntPtr newPtr = Marshal.ReadIntPtr (virtualGoodArray.Array, i * Marshal.SizeOf(typeof(IntPtr)));
                virtualGoods[i] = new VirtualGood(newPtr);
            #endif
            #if UNITY_ANDROID
                AndroidJavaObject tempJavaObject = tempJavaObjectArray.Call<AndroidJavaObject>("get",i);
                IntPtr newPtr = AndroidJNI.NewGlobalRef(tempJavaObject.GetRawObject());
                virtualGoods[i] = new VirtualGood(newPtr,new AndroidJavaObject(newPtr));
            #endif
            }
            return virtualGoods;
        }