Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 3
0
 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;
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 5
0
//		/**********************
//		 Buy Currency & Goods
//		**********************/

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