示例#1
0
        public static void SelectPlugin(
            PluginImporter libXcode10,
            PluginImporter libXcode11)
        {
            const BuildTarget platform = BuildTarget.iOS;

#if UNITY_EDITOR_OSX
            var version = GetXcodeVersion();
            if (version == new OSVersion(0))
            {
                throw new BuildFailedException($"Could not determine which version of Xcode was selected in the Build Settings. Xcode app was computed as \"{GetXcodeApplicationName()}\".");
            }

            if (version >= new OSVersion(11))
            {
                libXcode10?.SetCompatibleWithPlatform(platform, false);
                libXcode11?.SetCompatibleWithPlatform(platform, true);
            }
            else
            {
                libXcode10?.SetCompatibleWithPlatform(platform, true);
                libXcode11?.SetCompatibleWithPlatform(platform, false);
            }
#else
            libXcode10?.SetCompatibleWithPlatform(platform, false);
            libXcode11?.SetCompatibleWithPlatform(platform, true);
#endif
        }
        /// <summary>
        /// Sets the plugins.
        /// </summary>
        /// <param name="files">Files.</param>
        /// <param name="editorSettings">Editor settings.</param>
        /// <param name="settings">Settings.</param>
        static void SetPlugins(string[] files, Dictionary <string, string> editorSettings, Dictionary <BuildTarget, Dictionary <string, string> > settings)
        {
            if (files == null)
            {
                return;
            }

            foreach (string item in files)
            {
                PluginImporter pluginImporter = PluginImporter.GetAtPath(item) as PluginImporter;

                if (pluginImporter != null)
                {
                    pluginImporter.SetCompatibleWithAnyPlatform(false);
                    pluginImporter.SetCompatibleWithEditor(false);


                    if (editorSettings != null)
                    {
                        pluginImporter.SetCompatibleWithEditor(true);

                        foreach (KeyValuePair <string, string> pair in editorSettings)
                        {
                            pluginImporter.SetEditorData(pair.Key, pair.Value);
                        }
                    }

                    if (settings != null)
                    {
                        foreach (KeyValuePair <BuildTarget, Dictionary <string, string> > settingPair in settings)
                        {
                            pluginImporter.SetCompatibleWithPlatform(settingPair.Key, true);
                            if (settingPair.Value != null)
                            {
                                foreach (KeyValuePair <string, string> pair in settingPair.Value)
                                {
                                    pluginImporter.SetPlatformData(settingPair.Key, pair.Key, pair.Value);
                                }
                            }
                        }
                    }
                    else
                    {
                        foreach (BuildTarget target in Enum.GetValues(typeof(BuildTarget)))
                        {
                            pluginImporter.SetCompatibleWithPlatform(target, false);
                        }
                    }


                    pluginImporter.SaveAndReimport();

                    Debug.Log("SetPluginImportSettings Success :" + item);
                }
                else
                {
                    Debug.LogWarning("SetPluginImportSettings Faild :" + item);
                }
            }
        }
示例#3
0
	static void OnPostprocessAllAssets ( string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths ) 
	{
#if false //UNITY_5_0
		foreach ( string asset in importedAssets )
		{
			if ( asset.ToLower() == "assets/plugins/x86/oculusplugin.dll" || asset.ToLower() == "assets/plugins/x86_64/oculusplugin.dll" ) 
			{
				Debug.Log( "[OVRImportProcessor] Updating plugin compatibility: "  + asset );
				PluginImporter pluginImporter =  PluginImporter.GetAtPath( asset ) as PluginImporter;
				if ( pluginImporter != null ) 
				{
					bool x86_64 = asset.Contains( "x86_64" ); 
					pluginImporter.SetCompatibleWithEditor( true );
					pluginImporter.SetCompatibleWithAnyPlatform( false );
					pluginImporter.SetEditorData( "OS", "Windows" );
					if ( x86_64 ) 
					{
						pluginImporter.SetCompatibleWithPlatform( BuildTarget.StandaloneWindows, false );
						pluginImporter.SetCompatibleWithPlatform( BuildTarget.StandaloneWindows64, true );
					} 
					else 
					{
						pluginImporter.SetCompatibleWithPlatform( BuildTarget.StandaloneWindows64, false );
						pluginImporter.SetCompatibleWithPlatform( BuildTarget.StandaloneWindows, true );
					}
				}
				AssetDatabase.WriteImportSettingsIfDirty( asset );
			}
		}
#endif
	}
示例#4
0
        public override void PostBuild(NativePlugin plugin, NativeBuildOptions buildOptions)
        {
            base.PostBuild(plugin, buildOptions);

            string assetFile = CombinePath(
                AssetDatabase.GetAssetPath(plugin.pluginBinaryFolder),
                "Linux",
                buildOptions.Architecture.ToString(),
                string.Format("lib{0}.so", plugin.Name));

            PluginImporter pluginImporter = PluginImporter.GetAtPath((assetFile)) as PluginImporter;

            if (pluginImporter != null)
            {
                SetPluginBaseInfo(plugin, buildOptions, pluginImporter);

                pluginImporter.SetCompatibleWithAnyPlatform(false);
                pluginImporter.SetCompatibleWithEditor(true);
                pluginImporter.SetEditorData("OS", "Linux");
                pluginImporter.SetEditorData("CPU", buildOptions.Architecture.ToString());
                if (buildOptions.Architecture == Architecture.x86)
                {
                    pluginImporter.SetCompatibleWithPlatform(BuildTarget.StandaloneLinux, true);
                }
                else
                {
                    pluginImporter.SetCompatibleWithPlatform(BuildTarget.StandaloneLinux64, true);
                }

                pluginImporter.SaveAndReimport();
            }
        }
示例#5
0
 void _SetCompatibleWithPlatform(string platformName, bool enable)
 {
     if (_pluginImporter != null)
     {
         if (_pluginImporter.GetCompatibleWithPlatform(platformName) != enable)
         {
             _pluginImporter.SetCompatibleWithPlatform(platformName, enable);
             _isWritten = true;
         }
     }
 }
示例#6
0
        public void OnPreprocessBuild(BuildReport report)
        {
            var isARCoreRequired = ARCoreProjectSettings.Instance.IsARCoreRequired;

            Debug.LogFormat("Building application with {0} ARCore support.",
                            isARCoreRequired ? "REQUIRED" : "OPTIONAL");

            string[] requiredAarGuid = AssetDatabase.FindAssets("google_ar_required");
            string[] optionalAarGuid = AssetDatabase.FindAssets("google_ar_optional");
            if (requiredAarGuid.Length != 1 || optionalAarGuid.Length != 1)
            {
                throw new UnityEditor.Build.BuildFailedException(
                          "Not finding google_ar_required.aar and google_ar_optional.aar files needed for ARCore support. " +
                          "Were they moved from the ARCore SDK?");
            }

            PluginImporter arRequiredAAR = AssetImporter.GetAtPath(AssetDatabase.GUIDToAssetPath(requiredAarGuid[0])) as PluginImporter;
            PluginImporter arOptionalAAR = AssetImporter.GetAtPath(AssetDatabase.GUIDToAssetPath(optionalAarGuid[0])) as PluginImporter;

            if (arRequiredAAR == null || arOptionalAAR == null)
            {
                throw new UnityEditor.Build.BuildFailedException(
                          "Not finding google_ar_required.aar and google_ar_optional.aar files needed for ARCore support. " +
                          "Were they moved from the ARCore SDK?");
            }

            arRequiredAAR.SetCompatibleWithPlatform(BuildTarget.Android, isARCoreRequired);
            arOptionalAAR.SetCompatibleWithPlatform(BuildTarget.Android, !isARCoreRequired);
        }
        public static void ConfigurePluginPlatforms()
        {
            PluginImporter[] importers     = PluginImporter.GetAllImporters();
            PluginImporter   iOSPlugin     = null;
            PluginImporter   androidPlugin = null;

            foreach (PluginImporter importer in importers)
            {
                if (importer.assetPath.Contains(AudienceNetworkFramework))
                {
                    iOSPlugin = importer;
                    Debug.Log("Audience Network iOS plugin found at " + importer.assetPath + ".");
                }
                else if (importer.assetPath.Contains(AudienceNetworkAAR))
                {
                    androidPlugin = importer;
                    Debug.Log("Audience Network Android plugin found at " + importer.assetPath + ".");
                }
            }
            if (iOSPlugin != null)
            {
                iOSPlugin.SetCompatibleWithAnyPlatform(false);
                iOSPlugin.SetCompatibleWithEditor(false);
                iOSPlugin.SetCompatibleWithPlatform(BuildTarget.iOS, true);
                iOSPlugin.SetPlatformData(BuildTarget.iOS, FrameworkDependenciesKey, RequiredFrameworks);
                iOSPlugin.SaveAndReimport();
            }
            if (androidPlugin != null)
            {
                androidPlugin.SetCompatibleWithAnyPlatform(false);
                androidPlugin.SetCompatibleWithEditor(false);
                androidPlugin.SetCompatibleWithPlatform(BuildTarget.Android, true);
                androidPlugin.SaveAndReimport();
            }
        }
示例#8
0
        private static void OnScriptsReloaded()
        {
            if (EditorPrefs.GetBool("RTSL_BuildAll"))
            {
                EditorPrefs.SetBool("RTSL_BuildAll", false);
                try
                {
                    AssetDatabase.StartAssetEditing();

                    CreateAssetLibraryForActiveScene();
                    Debug.Log("Asset Libraries Updated");

                    CreateAssetLibrariesList();
                    Debug.Log("Asset Libraries List Updated");

                    CreateShaderProfiles();
                    Debug.Log("Shader Profiles Updated");
                }
                catch (Exception e)
                {
                    Debug.LogError(e);
                }
                finally
                {
                    AssetDatabase.StopAssetEditing();
                }

                try
                {
                    AssetDatabase.StartAssetEditing();
                    BuildTypeModel();
                    EditorUtility.DisplayProgressBar("Build All", "Updating type model import settings", 0.99f);
                }
                catch (Exception e)
                {
                    Debug.LogError(e);
                    EditorUtility.ClearProgressBar();
                }
                finally
                {
                    AssetDatabase.StopAssetEditing();
                }
            }

            if (EditorPrefs.GetBool("RTSL_UpdateTypeModelImportSettings"))
            {
                EditorPrefs.SetBool("RTSL_UpdateTypeModelImportSettings", false);
                try
                {
                    PluginImporter importer = AssetImporter.GetAtPath("Assets" + RTSLPath.UserRoot + "/" + TypeModelDll) as PluginImporter;
                    importer.SetCompatibleWithAnyPlatform(false);
                    importer.SetCompatibleWithPlatform(EditorUserBuildSettings.activeBuildTarget, true);
                    importer.SaveAndReimport();
                }
                finally
                {
                    EditorUtility.ClearProgressBar();
                }
            }
        }
    public static void EnableNativeVideoPlayer()
    {
        // rename NativeJavaPlayer.java.DISABLED to NativeJavaPlayer.java
        if (File.Exists(disabledPlayerFileName))
        {
            File.Move(disabledPlayerFileName, videoPlayerFileName);
            File.Move(disabledPlayerFileName + ".meta", videoPlayerFileName + ".meta");
        }

        AssetDatabase.ImportAsset(videoPlayerFileName);
        AssetDatabase.DeleteAsset(disabledPlayerFileName);

        // Enable audio plugins
        PluginImporter audio360      = (PluginImporter)AssetImporter.GetAtPath(audio360PluginPath);
        PluginImporter audio360exo29 = (PluginImporter)AssetImporter.GetAtPath(audio360Exo29PluginPath);

        if (audio360 != null && audio360exo29 != null)
        {
            audio360.SetCompatibleWithPlatform(BuildTarget.Android, true);
            audio360exo29.SetCompatibleWithPlatform(BuildTarget.Android, true);
            audio360.SaveAndReimport();
            audio360exo29.SaveAndReimport();
        }

        // Enable gradle build with exoplayer
        Gradle.Configuration.UseGradle();
        var lines = Gradle.Configuration.ReadLines();

        Gradle.Dependencies.AddDependency("com.google.android.exoplayer:exoplayer", "2.9.5", lines);
        Gradle.Configuration.WriteLines(lines);
    }
示例#10
0
        public override void PostBuild(NativePlugin plugin, NativeBuildOptions buildOptions)
        {
            base.PostBuild(plugin, buildOptions);

            string archName = buildOptions.Architecture == Architecture.ARMv7 ? "armeabi-v7a" : "x86";

            string assetFile = CombinePath(
                AssetDatabase.GetAssetPath(plugin.pluginBinaryFolder),
                "Android",
                archName,
                string.Format("lib{0}.so", plugin.Name));

            PluginImporter pluginImporter = PluginImporter.GetAtPath((assetFile)) as PluginImporter;

            if (pluginImporter != null)
            {
                SetPluginBaseInfo(plugin, buildOptions, pluginImporter);

                pluginImporter.SetCompatibleWithAnyPlatform(false);
                pluginImporter.SetCompatibleWithPlatform(BuildTarget.Android, true);
                pluginImporter.SetEditorData("CPU", buildOptions.Architecture.ToString());
                pluginImporter.SetEditorData("ANDROID_SDK_VERSION", buildOptions.AndroidSdkVersion.ToString());

                pluginImporter.SaveAndReimport();
            }
        }
示例#11
0
 private static void SetPluginCompatibleIdp(BuildTarget target, string path, bool enable)
 {
     //			if (File.Exists (path) == true || Directory.Exists (path) == true) {
     //				FileAttributes attr = File.GetAttributes (path);
     //				string[] pathSplit = path.Split ('/');
     //				string name = pathSplit [pathSplit.Length - 1];
     //				if ((attr & FileAttributes.Directory) == FileAttributes.Directory && name.Contains (".") == false) {
     //					Debug.LogError ("directory : " + path);
     //					string[] directoryPaths = Directory.GetDirectories (path, "*", SearchOption.TopDirectoryOnly);
     //					foreach (string directoryPath in directoryPaths) {
     //						SetPluginCompatibleIdp (target, directoryPath, enable);
     //					}
     //				} else {
     //					Debug.LogError ("file : " + path);
     if (File.Exists(path) == true || Directory.Exists(path) == true)
     {
         PluginImporter pluginImporter = PluginImporter.GetAtPath(path) as PluginImporter;
         if (pluginImporter != null)
         {
             if (pluginImporter.GetCompatibleWithAnyPlatform() == true)
             {
                 pluginImporter.SetCompatibleWithAnyPlatform(false);
             }
             if (pluginImporter.GetCompatibleWithPlatform(target) != enable)
             {
                 pluginImporter.SetCompatibleWithPlatform(target, enable);
                 pluginImporter.SaveAndReimport();
             }
         }
     }
     //				}
     //			}
 }
示例#12
0
        public static void SetPlatform(PluginImporter plugin, BuildTarget platform, bool enable)
        {
            plugin.SetCompatibleWithPlatform(platform, enable);

            if (enable)
            {
                switch (platform)
                {
                case BuildTarget.StandaloneWindows: {
                    SetPlatformEditor(plugin, "Windows", "X86");
                } break;

                case BuildTarget.StandaloneWindows64: {
                    SetPlatformEditor(plugin, "Windows", "X86_64");
                } break;

#if UNITY_2017_3_OR_NEWER
                case BuildTarget.StandaloneOSX: {
                    SetPlatformCPU(plugin, platform, "AnyCPU");
                    SetPlatformEditor(plugin, "OSX", "AnyCPU");
                } break;
#else
                case BuildTarget.StandaloneOSXIntel:
                case BuildTarget.StandaloneOSXIntel64: {
                    SetPlatformCPU(plugin, platform, "AnyCPU");
                } break;

                case BuildTarget.StandaloneOSXUniversal: {
                    SetPlatformCPU(plugin, platform, "None");
                    SetPlatformEditor(plugin, "OSX", "AnyCPU");
                } break;
#endif
                }
            }
        }
示例#13
0
    public static void DisableNativeVideoPlayer()
    {
        if (File.Exists(videoPlayerFileName))
        {
            File.Move(videoPlayerFileName, disabledPlayerFileName);
            File.Move(videoPlayerFileName + ".meta", disabledPlayerFileName + ".meta");
        }

        AssetDatabase.ImportAsset(disabledPlayerFileName);
        AssetDatabase.DeleteAsset(videoPlayerFileName);

        // Disable audio plugins
        PluginImporter audio360      = (PluginImporter)AssetImporter.GetAtPath(audio360PluginPath);
        PluginImporter audio360exo29 = (PluginImporter)AssetImporter.GetAtPath(audio360Exo29PluginPath);

        if (audio360 != null && audio360exo29 != null)
        {
            audio360.SetCompatibleWithPlatform(BuildTarget.Android, false);
            audio360exo29.SetCompatibleWithPlatform(BuildTarget.Android, false);
            audio360.SaveAndReimport();
            audio360exo29.SaveAndReimport();
        }

        // remove exoplayer and sourcesets from gradle file (leave other parts since they are harmless).
        if (Gradle.Configuration.IsUsingGradle())
        {
            var lines = Gradle.Configuration.ReadLines();
            Gradle.Dependencies.RemoveDependency("com.google.android.exoplayer:exoplayer", lines);
            Gradle.Dependencies.RemoveSourceSet("sourceSets.main.java.srcDir", lines);
            Gradle.Configuration.WriteLines(lines);
        }
    }
示例#14
0
 static void SetCompatiblePlatforms(PluginImporter pluginImporter, IEnumerable <BuildTarget> platforms)
 {
     foreach (var platform in platforms)
     {
         pluginImporter.SetCompatibleWithPlatform(platform, true);
     }
 }
示例#15
0
 /// <summary>
 /// Update the <see cref="PluginImporter"/> <paramref name="pluginImporter"/> to be explicitly
 /// incompatible with any build target.
 /// </summary>
 /// <param name="pluginImporter"></param>
 private static void ExcludeFromAllBuildTargets(PluginImporter pluginImporter)
 {
     pluginImporter.SetCompatibleWithAnyPlatform(false);
     foreach (var buildTarget in ALL_BUILD_TARGETS)
     {
         pluginImporter.SetCompatibleWithPlatform(buildTarget, false);
     }
 }
 private static void SetCompatibleWithPlatform(PluginImporter pluginImporter, BuildTarget buildTarget, bool enable)
 {
     if (pluginImporter.GetCompatibleWithPlatform(buildTarget) != enable)
     {
         pluginImporter.SetCompatibleWithPlatform(buildTarget, enable);
         mHasAtLeastOneLibraryBeenModified = true;
     }
 }
示例#17
0
    private void ToggleOculusPlugins(bool toggle)
    {
        oculusAndroidPlugin          = AssetImporter.GetAtPath("Assets/Oculus/VR/Plugins/1.40.0/Android/OVRPlugin.aar") as PluginImporter;
        oculusAndroidUniversalPlugin = AssetImporter.GetAtPath("Assets/Oculus/VR/Plugins/1.40.0/AndroidUniversal/OVRPlugin.aar") as PluginImporter;

        oculusAndroidPlugin.SetCompatibleWithPlatform(BuildTarget.Android, toggle);
        oculusAndroidUniversalPlugin.SetCompatibleWithPlatform(BuildTarget.Android, toggle);
    }
示例#18
0
 public static void SetEnablePluginImport(string[] plugins, bool enable = true)
 {
     foreach (var path in plugins)
     {
         PluginImporter vrlib = AssetImporter.GetAtPath(path) as PluginImporter;
         vrlib.SetCompatibleWithPlatform(BuildTarget.Android, enable);
     }
 }
示例#19
0
        static void FixPlayMakerMetroPluginSettings(PluginImporter pluginImporter)
        {
            LogChange("Fixed Plugin Settings: " + pluginImporter.assetPath);

            pluginImporter.SetCompatibleWithAnyPlatform(false);
            pluginImporter.SetCompatibleWithPlatform(BuildTarget.WSAPlayer, true);
            AssetDatabase.Refresh();
        }
示例#20
0
 static void SetCompatibleWithEditor(PluginImporter plugin)
 {
     plugin.SetCompatibleWithPlatform(BuildTarget.StandaloneLinux64, false);
     plugin.SetCompatibleWithPlatform(BuildTarget.StandaloneLinux, false);
     plugin.SetCompatibleWithPlatform(BuildTarget.StandaloneLinuxUniversal, false);
     plugin.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXIntel, false);
     plugin.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXIntel64, false);
     plugin.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXUniversal, false);
     plugin.SetCompatibleWithPlatform(BuildTarget.StandaloneWindows, false);
     plugin.SetCompatibleWithPlatform(BuildTarget.StandaloneWindows64, false);
     plugin.SaveAndReimport();
 }
    static bool SetCompatibleWithPlatform(PluginImporter plugin, BuildTarget platform, bool enable)
    {
        if (plugin.GetCompatibleWithPlatform(platform) == enable)
        {
            return(false);
        }

        plugin.SetCompatibleWithPlatform(platform, enable);
        return(true);
    }
 private static void RemoveFromAllPlatforms(PluginImporter pluginImporter, List <BuildTarget> buildTargets)
 {
     pluginImporter.SetEditorData("CPU", null);
     AddToAnyPlatform(pluginImporter, false);
     AddAllBuildTargets(buildTargets);
     foreach (var buildTarget in buildTargets)
     {
         pluginImporter.SetCompatibleWithPlatform(buildTarget, false);
     }
 }
示例#23
0
 private static void ClearAllPlatforms(PluginImporter plugin)
 {
     plugin.SetCompatibleWithEditor(false);
     plugin.SetCompatibleWithAnyPlatform(false);
     Enum.GetValues(typeof(BuildTarget))
     .Cast <BuildTarget>()
     .Where(target => !IsObsolete(target))
     .Where(target => (int)target != -2)
     .ToList()
     .ForEach(target => plugin.SetCompatibleWithPlatform(target, false));
 }
示例#24
0
        static void AddPlugin(string editorDir, string pluginDir)
        {
            if (Directory.Exists(pluginDir))
            {
                return;
            }

            // create plugin directory structure
            Debug.Log("Creating plugin dir: " + pluginDir);

            string[] components = pluginDir.Split('/'); // get path components
            if (components.Length == 0 || components[0] != "Assets")
            {
                Debug.LogError("Can't add " + Constants.PluginName + ". Unexpected plugin path: " + pluginDir);
                return;
            }

            string path = "Assets";

            for (int i = 1; i < components.Length; ++i)
            {
                string subpath = path + "/" + components[i]; // can't use Path.Combine since it will screw it up on Windows
                if (!Directory.Exists(subpath))
                {
                    AssetDatabase.CreateFolder(path, components[i]);
                }

                path = subpath;
            }

            // copy plugin files
            string[] pluginFiles =
            {
                "AndroidManifest.xml",
                "project.properties",
                "libs",
                "res"
            };

            foreach (string pluginFile in pluginFiles)
            {
                string srcPath = editorDir + "/" + pluginFile;
                string dstPath = pluginDir + "/" + pluginFile;

                AssetDatabase.CopyAsset(srcPath, dstPath);
            }

            PluginImporter pluginImporter = PluginImporter.GetAtPath(pluginDir) as PluginImporter;

            pluginImporter.SetCompatibleWithAnyPlatform(false);
            pluginImporter.SetCompatibleWithPlatform(BuildTarget.Android, true);
            AssetDatabase.ImportAsset(pluginDir, ImportAssetOptions.ImportRecursive);
        }
示例#25
0
        private void PostprocessBuild(BuildTarget target)
        {
            foreach (string path in binaryCompatibilitiesBeforeBuild.Keys)
            {
                PluginImporter importer = AssetImporter.GetAtPath(path) as PluginImporter;

                if (importer != null)
                {
                    importer.SetCompatibleWithPlatform(target, binaryCompatibilitiesBeforeBuild[path]);
                }
            }
        }
示例#26
0
    static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)
    {
                #if UNITY_4_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_4_7 || UNITY_5_5 || UNITY_5_4
        foreach (string importedAsset in importedAssets)
        {
            if (importedAsset.Equals(importedAssets[importedAssets.Length - 1]))
            {
                if (Directory.Exists(Utils.FixSlashesInPath("Assets/Plugins/Android/appodeal/assets")) && !Directory.Exists(Utils.FixSlashesInPath("Assets/Plugins/Android/assets")))
                {
                    if (EditorUtility.DisplayDialog("Appodeal Unity", "We have detected that you're using Unity" + Application.unityVersion + " and it can't compile android assets from library folder so Assets/Plugins/Android/appodeal/assets folder should be moved into Android folder.", "Move it for me", "Leave it there"))
                    {
                        Directory.Move(Utils.FixSlashesInPath("Assets/Plugins/Android/appodeal/assets"), Utils.FixSlashesInPath("Assets/Plugins/Android/assets"));
                        reimportFolder(Utils.FixSlashesInPath("Assets/Plugins/Android/assets"));
                        reimportFolder(Utils.FixSlashesInPath("Assets/Plugins/Android/appodeal"));
                    }
                }
            }
        }
                #endif

                #if UNITY_4_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_4_7
        if (File.Exists(Utils.FixSlashesInPath("Assets/Appodeal/SampleAndroidManifest.xml")) && !File.Exists(Utils.FixSlashesInPath("Assets/Plugins/Android/AndroidManifest.xml")))
        {
            FileUtil.CopyFileOrDirectory(Utils.FixSlashesInPath("Assets/Appodeal/SampleAndroidManifest.xml"), Utils.FixSlashesInPath("Assets/Plugins/Android/AndroidManifest.xml"));
        }
                #endif

                #if UNITY_5_5 || UNITY_5_4
        foreach (string plugin in Plugins)
        {
            string fullpath = Utils.FixSlashesInPath("Assets/Plugins/Android/" + plugin);
            if (File.Exists(fullpath))
            {
                PluginImporter pluginImporter = AssetImporter.GetAtPath(fullpath) as PluginImporter;
                if (!pluginImporter.GetCompatibleWithPlatform(BuildTarget.Android))
                {
                    pluginImporter.SetCompatibleWithPlatform(BuildTarget.Android, true);
                }
            }
        }

        string path = Utils.FixSlashesInPath("Assets/Plugins/Ionic.Zip.Unity.dll");
        if (File.Exists(path))
        {
            PluginImporter ionicPluginImporter = AssetImporter.GetAtPath(path) as PluginImporter;
            if (!ionicPluginImporter.GetCompatibleWithEditor())
            {
                ionicPluginImporter.SetCompatibleWithEditor(true);
            }
        }
                #endif
    }
 private static void AddToStandaloneAndEditorPlatforms(PluginImporter pluginImporter, List <BuildTarget> buildTargets, bool addToEditor)
 {
     foreach (var buildTarget in buildTargets)
     {
         Debug.LogFormat("TriLib: Adding '{0}' to '{1}' Platform.", pluginImporter.assetPath, buildTarget);
         pluginImporter.SetCompatibleWithPlatform(buildTarget, true);
     }
     if (addToEditor)
     {
         Debug.LogFormat("TriLib: Adding '{0}' to Editor.", pluginImporter.assetPath);
         pluginImporter.SetCompatibleWithEditor(true);
     }
 }
示例#28
0
    static void prepareWin10()
    {
        PluginImporter pi = (PluginImporter)PluginImporter.GetAtPath("Assets/Plugins/Metro/VungleSDKProxy.winmd");

        pi.SetPlatformData(BuildTarget.WSAPlayer, "PlaceholderPath", "Assets/Plugins/VungleSDKProxy.dll");
        pi.SaveAndReimport();
        pi = (PluginImporter)PluginImporter.GetAtPath("Assets/Plugins/Metro/VungleSDK.winmd");
        pi.SetPlatformData(BuildTarget.WSAPlayer, "SDK", "SDK81");
        pi = (PluginImporter)PluginImporter.GetAtPath("Assets/Plugins/Metro/UWP/VungleSDK.winmd");
        pi.SetCompatibleWithPlatform(BuildTarget.WSAPlayer, true);
        pi.SetPlatformData(BuildTarget.WSAPlayer, "SDK", "UWP");
        pi.SaveAndReimport();
    }
示例#29
0
    static void SetCompatibleWithWindows(PluginImporter plugin, BuildTarget platform)
    {
        plugin.SetCompatibleWithPlatform(platform, true);

        plugin.SetCompatibleWithPlatform(BuildTarget.StandaloneLinux64, false);
        plugin.SetCompatibleWithPlatform(BuildTarget.StandaloneLinux, false);
        plugin.SetCompatibleWithPlatform(BuildTarget.StandaloneLinuxUniversal, false);
        plugin.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXIntel, false);
        plugin.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXIntel64, false);
        plugin.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXUniversal, false);
        plugin.SaveAndReimport();
    }
示例#30
0
        public override void fixProblem()
        {
            PluginImporter imp = AssetImporter.GetAtPath(pluginPath) as PluginImporter;

            switch (platform)
            {
            case PlatformChecker.platforms.any:
                imp.SetCompatibleWithAnyPlatform(true);
                break;

            case PlatformChecker.platforms.editor:
                imp.SetCompatibleWithEditor(true);
                break;

            case PlatformChecker.platforms.android:
                imp.SetCompatibleWithPlatform(BuildTarget.Android, true);
                break;

            case PlatformChecker.platforms.ios:
                imp.SetCompatibleWithPlatform(BuildTarget.iOS, true);
                break;
            }
        }