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