Ejemplo n.º 1
0
        private void OnEDMAreaGUI()
        {
            if (edmVersion == null)
            {
                HelpStyles.BeginBoxScope();
                EditorGUILayout.HelpBox("In order to properly include third party dependencies in your project, " +
                                        "an External Dependency Manager is required.", MessageType.Error);
                EditorGUILayout.BeginHorizontal();
                GUILayout.Label("1. Download latest EDM4U.unitypackage", GUILayout.ExpandWidth(false));
                if (GUILayout.Button("here", EditorStyles.miniButton, GUILayout.ExpandWidth(false)))
                {
                    Application.OpenURL(Utils.latestEMD4uURL);
                }
                EditorGUILayout.EndHorizontal();
                GUILayout.Label("2. Import the EDM4U.unitypackage into your project.");
                HelpStyles.EndBoxScope();
                return;
            }
            if (edmRequiredNewer)
            {
                if (HelpStyles.WarningWithButton("To properly include third-party dependencies in your project, " +
                                                 "you need an External Dependency Manager version " + Utils.minEDM4UVersion + " or later.",
                                                 "Download"))
                {
                    Application.OpenURL(Utils.latestEMD4uURL);
                }
            }

            if (platform == BuildTarget.Android)
            {
#if UNITY_2019_3_OR_NEWER
                OnGradleTemplateDisabledGUI("Base Gradle", Utils.projectGradlePath);
                OnGradleTemplateDisabledGUI("Launcher Gradle", Utils.launcherGradlePath);
                OnGradleTemplateDisabledGUI("Gradle Properties", Utils.propertiesGradlePath);
#else
                OnGradleTemplateDisabledGUI("Gradle", Utils.mainGradlePath);
#endif

                if (HelpStyles.WarningWithButton("Changing dependencies will change the project settings. " +
                                                 "Please use Android Resolver after the change complete.", "Resolve", MessageType.Info))
                {
                    if (EditorUserBuildSettings.activeBuildTarget == BuildTarget.Android)
                    {
                        var succses = Utils.TryResolveAndroidDependencies();
                        EditorUtility.DisplayDialog("Android Dependencies",
                                                    succses ? "Resolution Succeeded" : "Resolution Failed. See the log for details.",
                                                    "OK");
                    }
                    else
                    {
                        EditorUtility.DisplayDialog("Android Dependencies",
                                                    "Android resolver not enabled. Unity Android platform target must be selected.",
                                                    "OK");
                    }
                }
                return;
            }
            if (platform == BuildTarget.iOS)
            {
                if (edmIOSStaticLinkProp != null && !( bool )edmIOSStaticLinkProp.GetValue(null, null))
                {
                    OnWarningGUI("Link frameworks statically disabled",
                                 "Please enable 'Add use_frameworks!' and 'Link frameworks statically' found under " +
                                 "'Assets -> External Dependency Manager -> iOS Resolver -> Settings' menu.\n" +
                                 "Failing to do this step may result in undefined behavior of the plugin and doubled import of frameworks.",
                                 MessageType.Warning);
                }

                if (PlayerSettings.muteOtherAudioSources)
                {
                    OnWarningGUI("Mute Other AudioSources enabled in PlayerSettings",
                                 "Known issue with muted all sounds in Unity Game after closing interstitial ads. " +
                                 "We recommend not using 'Mute Other AudioSources'.",
                                 MessageType.Warning);
                }
            }
        }