示例#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);
        }
示例#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;
 }
示例#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);
        }
示例#5
0
//		/**********************
//		 Buy Currency & Goods
//		**********************/

        public static void BuyVirtualCurrency(VirtualCurrency virtualCurrency, Action action)
        {
            action(true, new Error(), "", Actions.DoIapAction);
        }
示例#6
0
 public static void BuyVirtualCurrency(VirtualCurrency virtualCurrency, Action action)
 {
     virtualCurrency.Buy(action);
 }
示例#7
0
 public static void BuyVirtualCurrency(VirtualCurrency virtualCurrency, Action action)
 {
     virtualCurrency.Buy(action);
 }
示例#8
0
 //        /**********************
 //         Query Methods
 //         **********************/
 public static void GetVirtualCurrencies(VirtualCurrency.GetVirtualCurrencyArrayFinished callback)
 {
     callback(true,new Error(),new VirtualCurrency.VirtualCurrencyArray());
 }
示例#9
0
 public static void BuyVirtualCurrency(VirtualCurrency virtualCurrency, Action action)
 {
     ApplicasaIAPBuyVirtualCurrency(virtualCurrency.innerVirtualCurrency, action);
 }
示例#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);
        }
示例#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);
 }
示例#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;
        }
示例#16
0
 public static void UseCurrency(int amount, Currency currencyKind, Action action)
 {
     VirtualCurrency.UseAmount(amount, currencyKind, action);
 }
示例#17
0
 private static extern void ApplicasaIAPGetVirtualCurrenciesWithBlock(VirtualCurrency.GetVirtualCurrencyArrayFinished callback);
示例#18
0
 //        /**********************
 //         Buy Currency & Goods
 //        **********************/
 public static void BuyVirtualCurrency(VirtualCurrency virtualCurrency, Action action)
 {
     action(true,new Error(),"",Actions.DoIapAction);
 }
示例#19
0
 public static VirtualCurrency[] GetVirtualCurrencyArray(VirtualCurrencyArray virtualCurrencyArray)
 {
     VirtualCurrency[] virtualCurrencys = new VirtualCurrency[0];
     return(virtualCurrencys);
 }
示例#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);
        }