Example #1
0
        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);
        }
Example #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);
        }
Example #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);
     }
 }
Example #4
0
        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);
        }
Example #5
0
 public static void BuyWithRealMoney(VirtualGood virtualGood, Action action)
 {
     virtualGood.BuyWithRealMoney(action);
 }
Example #6
0
 public static void UseVirtualGood(VirtualGood virtualGood, int quantity, Action action)
 {
     action(true,new Error(),"",Actions.DoIapAction);
 }
Example #7
0
 public static void GetVirtualGoodsByCategoryPosition(VirtualGoodType type, int position, VirtualGood.GetVirtualGoodArrayFinished callback)
 {
     callback(true,new Error(),new VirtualGood.VirtualGoodArray());
 }
Example #8
0
 private static extern void ApplicasaIAPGetVirtualGoodsOfType(VirtualGoodType type, VirtualGood.GetVirtualGoodArrayFinished callback);
Example #9
0
 public static void UseVirtualGood(VirtualGood virtualGood, int quantity, Action action)
 {
     action(true, new Error(), "", Actions.DoIapAction);
 }
Example #10
0
 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);
 }
Example #11
0
        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;
        }
Example #12
0
 public static VirtualGood[] GetVirtualGoodArray(VirtualGoodArray virtualGoodArray)
 {
     VirtualGood[] virtualGoods = new VirtualGood[0];
     return virtualGoods;
 }
Example #13
0
        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;
        }
Example #14
0
 public static void BuyWithRealMoney(VirtualGood virtualGood, Action action)
 {
     ApplicasaIAPBuyWithRealMoney(virtualGood.innerVirtualGood, action);
 }
Example #15
0
 public static void BuyVirtualGood(VirtualGood virtualGood, int quantity, Currency currencyKind, Action action)
 {
     ApplicasaIAPBuyVirtualGood(virtualGood.innerVirtualGood, quantity, currencyKind, action);
 }
Example #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);
        }
Example #17
0
 public static void BuyVirtualGood(VirtualGood virtualGood, int quantity, Currency currencyKind, Action action)
 {
     action(true, new Error(), "", Actions.DoIapAction);
 }
Example #18
0
 public static void GetVirtualGoods(VirtualGoodType type, VirtualGood.GetVirtualGoodArrayFinished callback)
 {
     ApplicasaIAPGetVirtualGoodsOfType(type, callback);
 }
Example #19
0
 public static void UseVirtualGood(VirtualGood virtualGood, int quantity, Action action)
 {
     ApplicasaIAPUseVirtualGood(virtualGood.innerVirtualGood, quantity, action);
 }
Example #20
0
 public static void GetVirtualGoods(VirtualGoodType type, VirtualGoodCategory virtualGoodCategory, VirtualGood.GetVirtualGoodArrayFinished callback)
 {
     ApplicasaIAPGetVirtualGoodsOfTypeAndCategory(type, virtualGoodCategory.innerVirtualGoodCategory , callback);
 }
Example #21
0
 public static void GetVirtualGoods(VirtualGoodType type, VirtualGoodCategory virtualGoodCategory, VirtualGood.GetVirtualGoodArrayFinished callback)
 {
     callback(true,new Error(),new VirtualGood.VirtualGoodArray());
 }
Example #22
0
 public static void GetVirtualGoodsByCategoryPosition(VirtualGoodType type, int position, VirtualGood.GetVirtualGoodArrayFinished callback)
 {
     ApplicasaIAPGetVirtualGoodsByCategoryPosition(type, position , callback);
 }
Example #23
0
 private static extern void ApplicasaIAPGetVirtualGoodsOfTypeAndCategory(VirtualGoodType type, IntPtr virtualGoodCategory, VirtualGood.GetVirtualGoodArrayFinished callback);
Example #24
0
 public static void UseVirtualGood(VirtualGood virtualGood, int quantity, Action action)
 {
     virtualGood.Use(quantity,action);
 }
Example #25
0
 public static void BuyVirtualGood(VirtualGood virtualGood, int quantity, Currency currencyKind, Action action)
 {
     virtualGood.Buy(quantity,currencyKind,action);
 }
Example #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);
     }
 }
Example #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);
 }
Example #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);
        }
Example #29
0
 public static VirtualGood[] GetVirtualGoodArray(VirtualGoodArray virtualGoodArray)
 {
     VirtualGood[] virtualGoods = new VirtualGood[0];
     return(virtualGoods);
 }
Example #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);
 }
Example #31
0
 public static void BuyVirtualGood(VirtualGood virtualGood, int quantity, Currency currencyKind, Action action)
 {
     virtualGood.Buy(quantity, currencyKind, action);
 }
Example #32
0
 private static extern void ApplicasaIAPGetVirtualGoodsByCategoryPosition(VirtualGoodType type, int position, VirtualGood.GetVirtualGoodArrayFinished callback);
Example #33
0
 public static void BuyWithRealMoney(VirtualGood virtualGood, Action action)
 {
     virtualGood.BuyWithRealMoney(action);
 }
Example #34
0
 public static void BuyVirtualGood(VirtualGood virtualGood, int quantity, Currency currencyKind, Action action)
 {
     action(true,new Error(),"",Actions.DoIapAction);
 }
Example #35
0
 public static void BuyWithRealMoney(VirtualGood virtualGood, Action action)
 {
     action(true, new Error(), "", Actions.DoIapAction);
 }
Example #36
0
 public static void BuyWithRealMoney(VirtualGood virtualGood, Action action)
 {
     action(true,new Error(),"",Actions.DoIapAction);
 }
Example #37
0
 public static void UseVirtualGood(VirtualGood virtualGood, int quantity, Action action)
 {
     virtualGood.Use(quantity, action);
 }
Example #38
0
        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;
        }