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