Exemplo n.º 1
0
        public static void GetVirtualGoodCategories(VirtualGoodCategory.GetVirtualGoodCategoryArrayFinished callback)
        {
            if (javaUnityApplicasaIAP == null)
            {
                javaUnityApplicasaIAP = new AndroidJavaClass("com.applicasaunity.Unity.ApplicasaIAP");
            }
            Error error;

            error.Id      = 1;
            error.Message = "Success";

            AndroidJavaObject virtualGoodCategoryArrayJava = javaUnityApplicasaIAP.CallStatic <AndroidJavaObject>("ApplicasaIAPGetVirtualGoodCategoriesWithBlock");

            VirtualGoodCategory.VirtualGoodCategoryArray virtualGoodCategoryArray = new VirtualGoodCategory.VirtualGoodCategoryArray();

            virtualGoodCategoryArray.Array = virtualGoodCategoryArrayJava.GetRawObject();
            AndroidJavaObject[] convertedArray = AndroidJNIHelper.ConvertFromJNIArray <AndroidJavaObject[]>(virtualGoodCategoryArray.Array);
            int count = 0;

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

            callback(true, error, virtualGoodCategoryArray);
        }
Exemplo n.º 2
0
        public static void GetVirtualGoodCategories(VirtualGoodCategory.GetVirtualGoodCategoryArrayFinished callback)
        {
            if(javaUnityApplicasaIAP==null)
                javaUnityApplicasaIAP = new AndroidJavaClass("com.applicasaunity.Unity.ApplicasaIAP");
            Error error;
            error.Id=1;
            error.Message="Success";

            AndroidJavaObject virtualGoodCategoryArrayJava = javaUnityApplicasaIAP.CallStatic<AndroidJavaObject>("ApplicasaIAPGetVirtualGoodCategoriesWithBlock");
            VirtualGoodCategory.VirtualGoodCategoryArray virtualGoodCategoryArray = new VirtualGoodCategory.VirtualGoodCategoryArray();

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

            callback(true,error,virtualGoodCategoryArray);
        }