Exemple #1
0
        public static VirtualCurrency[] GetVirtualCurrencyArray(VirtualCurrencyArray virtualCurrencyArray)
        {
            VirtualCurrency[] virtualCurrencys = new VirtualCurrency[virtualCurrencyArray.ArraySize];

            for (int i = 0; i < virtualCurrencyArray.ArraySize; i++)
            {
                IntPtr newPtr = Marshal.ReadIntPtr(virtualCurrencyArray.Array, i * Marshal.SizeOf(typeof(IntPtr)));
                virtualCurrencys[i] = new VirtualCurrency(newPtr);
            }
            return(virtualCurrencys);
        }
Exemple #2
0
//		/**********************
//		 Buy Currency & Goods
//		**********************/

        public static void BuyVirtualCurrency(VirtualCurrency virtualCurrency, Action action)
        {
            if (javaUnityApplicasaIAP == null)
            {
                javaUnityApplicasaIAP = new AndroidJavaClass("com.applicasaunity.Unity.ApplicasaIAP");
            }
            int uniqueActionID = Core.currentCallbackID;

            Core.currentCallbackID++;
            Core.setActionCallback(action, uniqueActionID);
            javaUnityApplicasaIAP.CallStatic("ApplicasaIAPBuyVirtualCurrency", virtualCurrency.innerVirtualCurrencyJavaObject, uniqueActionID);
        }
 public static VirtualCurrency[] GetVirtualCurrencyArray(VirtualCurrencyArray virtualCurrencyArray)
 {
     VirtualCurrency[] virtualCurrencies = new VirtualCurrency[virtualCurrencyArray.ArraySize];
     #if UNITY_ANDROID
     AndroidJavaObject tempJavaObjectArray=new AndroidJavaObject(virtualCurrencyArray.Array);
     #endif
     for (int i = 0; i < virtualCurrencyArray.ArraySize; i++)
     {
     #if UNITY_IPHONE
         IntPtr newPtr = Marshal.ReadIntPtr (virtualCurrencyArray.Array, i * Marshal.SizeOf(typeof(IntPtr)));
         virtualCurrencies[i] = new VirtualCurrency(newPtr);
     #endif
     #if UNITY_ANDROID
         AndroidJavaObject tempJavaObject = tempJavaObjectArray.Call<AndroidJavaObject>("get",i);
         IntPtr newPtr = AndroidJNI.NewGlobalRef(tempJavaObject.GetRawObject());
         virtualCurrencies[i] = new VirtualCurrency(newPtr, new AndroidJavaObject(newPtr));
     #endif
     }
     return virtualCurrencies;
 }
Exemple #4
0
        public static VirtualCurrency[] GetVirtualCurrencyArray(VirtualCurrencyArray virtualCurrencyArray)
        {
            VirtualCurrency[]   virtualCurrencyInner = new VirtualCurrency[virtualCurrencyArray.ArraySize];
            AndroidJavaObject[] bigArray             = AndroidJNIHelper.ConvertFromJNIArray <AndroidJavaObject[]>(virtualCurrencyArray.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];
                    virtualCurrencyInner[count] = new VirtualCurrency(tempObj.GetRawObject(), tempObj);
                    count++;
                }
            }
            return(virtualCurrencyInner);
        }
Exemple #5
0
//		/**********************
//		 Buy Currency & Goods
//		**********************/

        public static void BuyVirtualCurrency(VirtualCurrency virtualCurrency, Action action)
        {
            action(true, new Error(), "", Actions.DoIapAction);
        }
Exemple #6
0
 public static void BuyVirtualCurrency(VirtualCurrency virtualCurrency, Action action)
 {
     virtualCurrency.Buy(action);
 }
Exemple #7
0
 public static void BuyVirtualCurrency(VirtualCurrency virtualCurrency, Action action)
 {
     virtualCurrency.Buy(action);
 }
Exemple #8
0
 //        /**********************
 //         Query Methods
 //         **********************/
 public static void GetVirtualCurrencies(VirtualCurrency.GetVirtualCurrencyArrayFinished callback)
 {
     callback(true,new Error(),new VirtualCurrency.VirtualCurrencyArray());
 }
Exemple #9
0
 public static void BuyVirtualCurrency(VirtualCurrency virtualCurrency, Action action)
 {
     ApplicasaIAPBuyVirtualCurrency(virtualCurrency.innerVirtualCurrency, action);
 }
Exemple #10
0
        //        /**********************
        //         Query Methods
        //         **********************/
        public static void GetVirtualCurrencies(VirtualCurrency.GetVirtualCurrencyArrayFinished callback)
        {
            if(javaUnityApplicasaIAP==null)
                javaUnityApplicasaIAP = new AndroidJavaClass("com.applicasaunity.Unity.ApplicasaIAP");
            Error error;
            error.Id=1;
            error.Message="Success";

            AndroidJavaObject virtualCurrencyArrayJava = javaUnityApplicasaIAP.CallStatic<AndroidJavaObject>("ApplicasaIAPGetVirtualCurrenciesWithBlock");
            VirtualCurrency.VirtualCurrencyArray virtualCurrencyArray = new VirtualCurrency.VirtualCurrencyArray();

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

            callback(true,error,virtualCurrencyArray);
        }
Exemple #11
0
 //        /**********************
 //         Buy Currency & Goods
 //        **********************/
 public static void BuyVirtualCurrency(VirtualCurrency virtualCurrency, Action action)
 {
     if(javaUnityApplicasaIAP==null)
         javaUnityApplicasaIAP = new AndroidJavaClass("com.applicasaunity.Unity.ApplicasaIAP");
     int uniqueActionID=Core.currentCallbackID;
     Core.currentCallbackID++;
     Core.setActionCallback(action,uniqueActionID);
     javaUnityApplicasaIAP.CallStatic("ApplicasaIAPBuyVirtualCurrency",virtualCurrency.innerVirtualCurrencyJavaObject, uniqueActionID);
 }
Exemple #12
0
 public static void GetVirtualCurrencies(VirtualCurrency.GetVirtualCurrencyArrayFinished callback)
 {
     ApplicasaIAPGetVirtualCurrenciesWithBlock(callback);
 }
        public static VirtualCurrency[] GetVirtualCurrencyArray(VirtualCurrencyArray virtualCurrencyArray)
        {
            VirtualCurrency[] virtualCurrencyInner = new VirtualCurrency[virtualCurrencyArray.ArraySize];
            AndroidJavaObject[] bigArray = AndroidJNIHelper.ConvertFromJNIArray<AndroidJavaObject[]>(virtualCurrencyArray.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];
                    virtualCurrencyInner[count] = new VirtualCurrency(tempObj.GetRawObject(),tempObj);
                    count++;
                }
            }
            return virtualCurrencyInner;
        }
 public static VirtualCurrency[] GetVirtualCurrencyArray(VirtualCurrencyArray virtualCurrencyArray)
 {
     VirtualCurrency[] virtualCurrencys = new VirtualCurrency[0];
     return virtualCurrencys;
 }
        public static VirtualCurrency[] GetVirtualCurrencyArray(VirtualCurrencyArray virtualCurrencyArray)
        {
            VirtualCurrency[] virtualCurrencys = new VirtualCurrency[virtualCurrencyArray.ArraySize];

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

                IntPtr newPtr = Marshal.ReadIntPtr (virtualCurrencyArray.Array, i * Marshal.SizeOf(typeof(IntPtr)));
                virtualCurrencys[i] = new VirtualCurrency(newPtr);
            }
            return virtualCurrencys;
        }
Exemple #16
0
 public static void UseCurrency(int amount, Currency currencyKind, Action action)
 {
     VirtualCurrency.UseAmount(amount, currencyKind, action);
 }
Exemple #17
0
 private static extern void ApplicasaIAPGetVirtualCurrenciesWithBlock(VirtualCurrency.GetVirtualCurrencyArrayFinished callback);
Exemple #18
0
 //        /**********************
 //         Buy Currency & Goods
 //        **********************/
 public static void BuyVirtualCurrency(VirtualCurrency virtualCurrency, Action action)
 {
     action(true,new Error(),"",Actions.DoIapAction);
 }
Exemple #19
0
 public static VirtualCurrency[] GetVirtualCurrencyArray(VirtualCurrencyArray virtualCurrencyArray)
 {
     VirtualCurrency[] virtualCurrencys = new VirtualCurrency[0];
     return(virtualCurrencys);
 }
Exemple #20
0
        //        /**********************
        //         Query Methods
        //         **********************/
        public static void GetVirtualCurrencies(VirtualCurrency.GetVirtualCurrencyArrayFinished callback)
        {
            if(javaUnityApplicasaIAP==null)
                javaUnityApplicasaIAP = new AndroidJavaClass("com.applicasaunity.Unity.ApplicasaIAP");
            Error error;
            error.Id=1;
            error.Message="Success";

            AndroidJavaObject virtualCurrencyArrayJava = javaUnityApplicasaIAP.CallStatic<AndroidJavaObject>("ApplicasaIAPGetVirtualCurrenciesWithBlock");

            VirtualCurrency.VirtualCurrencyArray virtualCurrencyArray;

            virtualCurrencyArray.ArraySize=virtualCurrencyArrayJava.Call<int>("size");
            virtualCurrencyArray.Array=virtualCurrencyArrayJava.GetRawObject();

            callback(true,error,virtualCurrencyArray);
        }