Esempio n. 1
0
 public static void IOS_InstallPlugin(bool IsFirstInstall = true)
 {
     FileStaticAPI.CopyFolder(IOS_SOURCE_PATH, IOS_DESTANATION_PATH);
 }
    public static void Android_InstallPlugin(bool IsFirstInstall = true)
    {
        //Unity 5 upgdare:
        FileStaticAPI.DeleteFile(ANDROID_SOURCE_PATH + "libs/httpclient-4.3.1.jar");
        FileStaticAPI.DeleteFile(ANDROID_SOURCE_PATH + "libs/signpost-commonshttp4-1.2.1.2.jar");
        FileStaticAPI.DeleteFile(ANDROID_SOURCE_PATH + "libs/signpost-core-1.2.1.2.jar");
        FileStaticAPI.DeleteFile(ANDROID_SOURCE_PATH + "libs/libGoogleAnalyticsServices.jar");

        FileStaticAPI.DeleteFile(ANDROID_SOURCE_PATH + "libs/android-support-v4.jar");
        FileStaticAPI.DeleteFile(ANDROID_SOURCE_PATH + "libs/image-chooser-library-1.3.0.jar");
        FileStaticAPI.DeleteFile(ANDROID_SOURCE_PATH + "libs/twitter4j-core-3.0.5.jar");
        FileStaticAPI.DeleteFile(ANDROID_SOURCE_PATH + "libs/google-play-services.jar");


        FileStaticAPI.DeleteFile(ANDROID_SOURCE_PATH + "social/an_social.jar");
        FileStaticAPI.DeleteFile(ANDROID_SOURCE_PATH + "social/twitter4j-core-3.0.5.jar");


        FileStaticAPI.DeleteFile(ANDROID_SOURCE_PATH + "google_play/an_googleplay.jar");
        FileStaticAPI.DeleteFile(ANDROID_SOURCE_PATH + "google_play/google-play-services.jar");

        FileStaticAPI.DeleteFile(ANDROID_SOURCE_PATH + "billing/an_billing.jar");



        FileStaticAPI.CopyFile(ANDROID_SOURCE_PATH + "libs/android-support-v4.txt", ANDROID_DESTANATION_PATH + "libs/android-support-v4.jar");
        FileStaticAPI.CopyFile(ANDROID_SOURCE_PATH + "androidnative.txt", ANDROID_DESTANATION_PATH + "androidnative.jar");
        FileStaticAPI.CopyFile(ANDROID_SOURCE_PATH + "mobilenativepopups.txt", ANDROID_DESTANATION_PATH + "mobilenativepopups.jar");



        FileStaticAPI.CopyFolder(ANDROID_SOURCE_PATH + "facebook", ANDROID_DESTANATION_PATH + "facebook");

                #if UNITY_3_5 || UNITY_4_0 || UNITY_4_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_5 || UNITY_4_6
                #else
        FileStaticAPI.DeleteFolder(ANDROID_SOURCE_PATH + "facebook");
                #endif

        if (IsFirstInstall)
        {
            EnableBillingAPI();
            EnableGooglePlayAPI();
            EnableSocialAPI();
            EnableCameraAPI();
            EnableAppLicensingAPI();
        }



        string file;
        file = "AN_Res/res/values/analytics.xml";
        if (!FileStaticAPI.IsFileExists(ANDROID_DESTANATION_PATH + file))
        {
            FileStaticAPI.CopyFile(ANDROID_SOURCE_PATH + file, ANDROID_DESTANATION_PATH + file);
        }


        file = "AN_Res/res/values/ids.xml";
        if (!FileStaticAPI.IsFileExists(ANDROID_DESTANATION_PATH + file))
        {
            FileStaticAPI.CopyFile(ANDROID_SOURCE_PATH + file, ANDROID_DESTANATION_PATH + file);
        }

        file = "AN_Res/res/xml/file_paths.xml";
        if (!FileStaticAPI.IsFileExists(ANDROID_DESTANATION_PATH + file))
        {
            FileStaticAPI.CopyFile(ANDROID_SOURCE_PATH + file, ANDROID_DESTANATION_PATH + file);
        }


        file = "AN_Res/res/values/version.xml";
        FileStaticAPI.CopyFile(ANDROID_SOURCE_PATH + file, ANDROID_DESTANATION_PATH + file);

        file = "AN_Res/project.properties";
        FileStaticAPI.CopyFile(ANDROID_SOURCE_PATH + file, ANDROID_DESTANATION_PATH + file);

        file = "AN_Res/AndroidManifest.xml";
        FileStaticAPI.CopyFile(ANDROID_SOURCE_PATH + file, ANDROID_DESTANATION_PATH + file);

        //First install dependense

        file = "AndroidManifest.xml";
        if (!FileStaticAPI.IsFileExists(ANDROID_DESTANATION_PATH + file))
        {
            FileStaticAPI.CopyFile(ANDROID_SOURCE_PATH + file, ANDROID_DESTANATION_PATH + file);
        }

        AssetDatabase.Refresh();
    }