private void Entitlements()
        {
            Texture2D entitlements = SA_EditorAssets.GetTextureAtPath(ISD_Skin.ICONS_PATH + "entitlements.png");

            using (new SA_WindowBlockWithIndent(new GUIContent("Entitlements", entitlements))) {
                EditorGUILayout.HelpBox("Entitlements confer specific capabilities or security permissions to your iOS or macOS app.\n" +
                                        "By default Entitlements file is generated based on your deploy settings, " +
                                        "but you may alos provide own version of the entitlements file by using manual mode", MessageType.Info);
                using (new SA_GuiBeginHorizontal()) {
                    GUILayout.FlexibleSpace();
                    bool click = m_entitlementsLink.DrawWithCalcSize();
                    if (click)
                    {
                        Application.OpenURL("https://developer.apple.com/documentation/uikit/core_app/protecting_the_user_s_privacy?language=objc");
                    }
                }

                EditorGUILayout.Space();

                ISD_Settings.Instance.EntitlementsMode = (ISD_EntitlementsGenerationMode)SA_EditorGUILayout.EnumPopup("Generation Mode", ISD_Settings.Instance.EntitlementsMode);
                if (ISD_Settings.Instance.EntitlementsMode == ISD_EntitlementsGenerationMode.Manual)
                {
                    EditorGUILayout.BeginHorizontal();
                    EditorGUILayout.LabelField("Entitlements File:");
                    ISD_Settings.Instance.EntitlementsFile = EditorGUILayout.ObjectField(ISD_Settings.Instance.EntitlementsFile, typeof(UnityEngine.Object), false);
                    EditorGUILayout.EndHorizontal();
                }
            }
        }
예제 #2
0
        protected override void OnServiceUI()
        {
            using (new SA_WindowBlockWithSpace(new GUIContent("Editor Testing")))
            {
                using (new SA_GuiBeginHorizontal())
                {
                    GUILayout.FlexibleSpace();
                    var click = m_LearnMoreLink.DrawWithCalcSize();
                    if (click)
                    {
                        Application.OpenURL("https://unionassets.com/ultimate-mobile-pro/test-inside-the-editor-793#restore-purchases");
                    }
                }

                ReorderableListGUI.Title("Products Restore Emulation");
                ReorderableListGUI.ListField(UM_Settings.Instance.TestRestoreProducts,
                                             (position, text) => { return(EditorGUI.TextField(position, text)); },
                                             () => { EditorGUILayout.LabelField("All configured products will be restored by default."); }
                                             );
            }
        }
예제 #3
0
        protected override void OnServiceUI()
        {
            using (new SA_WindowBlockWithSpace(new GUIContent("Protecting the User's Privacy"))) {
                EditorGUILayout.HelpBox("Once you link with iOS 10 you must declare access to any user private data types. " +
                                        "Since by default Unity includes libraries that may access API user private data, " +
                                        "the app info.plist mus contains the key's spsifayed bellow. " +
                                        "How ever user will only see this message if you call API that requires private permission. " +
                                        "If you not using such API, you can leave it as is.", MessageType.Info);



                using (new SA_GuiBeginHorizontal()) {
                    GUILayout.FlexibleSpace();
                    bool click = m_privacyLink.DrawWithCalcSize();
                    if (click)
                    {
                        Application.OpenURL("https://developer.apple.com/documentation/uikit/core_app/protecting_the_user_s_privacy?language=objc");
                    }
                }

                ISN_Settings.Instance.CameraUsageDescriptionEnabled = SA_EditorGUILayout.ToggleFiled(CameraUsageDescription, ISN_Settings.Instance.CameraUsageDescriptionEnabled, SA_StyledToggle.ToggleType.EnabledDisabled);
                using (new SA_GuiEnable(ISN_Settings.Instance.CameraUsageDescriptionEnabled)) {
                    using (new SA_GuiIndentLevel(1)) {
                        ISN_Settings.Instance.CameraUsageDescription = EditorGUILayout.TextArea(ISN_Settings.Instance.CameraUsageDescription, SA_PluginSettingsWindowStyles.TextArea, GUILayout.Height(30));
                    }
                }



                EditorGUILayout.Space();
                ISN_Settings.Instance.PhotoLibraryUsageDescriptionEnabled = SA_EditorGUILayout.ToggleFiled(PhotoLibraryUsageDescription, ISN_Settings.Instance.PhotoLibraryUsageDescriptionEnabled, SA_StyledToggle.ToggleType.EnabledDisabled);
                using (new SA_GuiEnable(ISN_Settings.Instance.PhotoLibraryUsageDescriptionEnabled)) {
                    using (new SA_GuiIndentLevel(1)) {
                        ISN_Settings.Instance.PhotoLibraryUsageDescription = EditorGUILayout.TextArea(ISN_Settings.Instance.PhotoLibraryUsageDescription, SA_PluginSettingsWindowStyles.TextArea, GUILayout.Height(30));
                    }
                }



                EditorGUILayout.Space();
                ISN_Settings.Instance.PhotoLibraryAddUsageDescriptionEnabled = SA_EditorGUILayout.ToggleFiled(PhotoLibraryAddUsageDescription, ISN_Settings.Instance.PhotoLibraryAddUsageDescriptionEnabled, SA_StyledToggle.ToggleType.EnabledDisabled);
                using (new SA_GuiEnable(ISN_Settings.Instance.PhotoLibraryAddUsageDescriptionEnabled)) {
                    using (new SA_GuiIndentLevel(1)) {
                        ISN_Settings.Instance.PhotoLibraryAddUsageDescription = EditorGUILayout.TextArea(ISN_Settings.Instance.PhotoLibraryAddUsageDescription, SA_PluginSettingsWindowStyles.TextArea, GUILayout.Height(30));
                    }
                }


                EditorGUILayout.Space();
                ISN_Settings.Instance.MicrophoneUsageDescriptionEnabled = SA_EditorGUILayout.ToggleFiled(MicrophoneUsageDescription, ISN_Settings.Instance.MicrophoneUsageDescriptionEnabled, SA_StyledToggle.ToggleType.EnabledDisabled);
                using (new SA_GuiEnable(ISN_Settings.Instance.MicrophoneUsageDescriptionEnabled)) {
                    using (new SA_GuiIndentLevel(1)) {
                        ISN_Settings.Instance.MicrophoneUsageDescription = EditorGUILayout.TextArea(ISN_Settings.Instance.MicrophoneUsageDescription, SA_PluginSettingsWindowStyles.TextArea, GUILayout.Height(30));
                    }
                }
            }



            using (new SA_WindowBlockWithSpace(new GUIContent("Allowed schemes to query"))) {
                SA_EditorGUILayout.ReorderablList(ISN_Settings.Instance.ApplicationQueriesSchemes,
                                                  (ISN_UIUrlType scheme) => {
                    return(scheme.Identifier);
                },
                                                  (ISN_UIUrlType scheme) => {
                    EditorGUILayout.BeginHorizontal();
                    EditorGUILayout.LabelField("Identifier");
                    scheme.Identifier = EditorGUILayout.TextField(scheme.Identifier);
                    EditorGUILayout.EndHorizontal();
                },
                                                  () => {
                    ISN_UIUrlType newUlr = new ISN_UIUrlType("url_sheme");
                    ISN_Settings.Instance.ApplicationQueriesSchemes.Add(newUlr);
                });
            }
        }
예제 #4
0
        public override void OnGUI()
        {
            using (new SA_WindowBlockWithSpace(new GUIContent("Log Level")))
            {
                EditorGUILayout.HelpBox("We recommend you to keep full logging level while your project in development mode. " +
                                        "Full communication logs between Native plugin part & " +
                                        "Unity side will be only available with Info logging  level enabled. \n" +
                                        "Disabling the error logs isn't recommended.", MessageType.Info);


                using (new SA_GuiBeginHorizontal())
                {
                    var logLevel = AN_Settings.Instance.LogLevel;
                    logLevel.Info    = GUILayout.Toggle(logLevel.Info, Info, GUILayout.Width(80));
                    logLevel.Warning = GUILayout.Toggle(logLevel.Warning, Warnings, GUILayout.Width(100));
                    logLevel.Error   = GUILayout.Toggle(logLevel.Error, Errors, GUILayout.Width(100));
                }

                EditorGUILayout.Space();
                EditorGUILayout.HelpBox("On some Android devices, Log.d or Log.e methods will not print anything to console," +
                                        "so sometimes the only ability to see the logs is to enable the WTF printing. This will make all" +
                                        "logs to be printed with Log.wtf method despite message log level.", MessageType.Info);

                AN_Settings.Instance.WTFLogging = GUILayout.Toggle(AN_Settings.Instance.WTFLogging, "WTF Logging", GUILayout.Width(130));
            }

            using (new SA_WindowBlockWithSpace(new GUIContent("Environment Management")))
            {
                EditorGUILayout.HelpBox("The Android Native plugin will alter manifest " +
                                        "automatically for your convenience. But in case you want to do it manually, " +
                                        "you may un-toggle the checkbox below \n" +
                                        "The plugin manifest is located under: " + AN_Settings.ANDROID_CORE_LIB_PATH, MessageType.Info);
                AN_Settings.Instance.ManifestManagement = SA_EditorGUILayout.ToggleFiled("Auto Manifest Management", AN_Settings.Instance.ManifestManagement, SA_StyledToggle.ToggleType.EnabledDisabled);

                EditorGUILayout.Space();
                EditorGUILayout.HelpBox("The Android Resolver plugin will download and integrate Android library dependencies " +
                                        "and handle any conflicts between plugins that share the same dependencies. \n" +
                                        "The Resolver is an additional third-party plugin. You need to download, install and configure it" +
                                        "Before Android Native will able to rely on this plugin and disable internal libraries.",
                                        MessageType.Info);


                using (new SA_GuiBeginHorizontal())
                {
                    GUILayout.Label(UnityJarResolverText, GUILayout.MaxWidth(120));
                    if (AN_Settings.Instance.UseUnityJarResolver)
                    {
                        if (AN_Settings.Instance.UnityJarResolverVersion != null && AN_Settings.Instance.UnityJarResolverVersion.Length > 0)
                        {
                            UnityJarResolverState = new GUIContent("version " + AN_Settings.Instance.UnityJarResolverVersion, "Version of current Jar Resolver.");
                        }
                        else
                        {
                            UnityJarResolverState = new GUIContent("Enabled");
                        }
                    }
                    else
                    {
                        UnityJarResolverState = new GUIContent("Disabled");
                    }
                    GUILayout.Label(UnityJarResolverState, GUILayout.MaxWidth(100));
                    GUILayout.FlexibleSpace();


                    GUIContent restartResolveContent = new GUIContent("  Restart Resolver", SA_Skin.GetGenericIcon("refresh.png"));
                    var        pressed = GUILayout.Button(restartResolveContent, new GUILayoutOption[2] {
                        GUILayout.Width(140), GUILayout.Height(15)
                    });
                    if (pressed)
                    {
                        AN_ResolveManager.ProcessAssets();
                        GUIUtility.ExitGUI();
                    }
                }
                using (new SA_GuiBeginHorizontal())
                {
                    GUILayout.FlexibleSpace();
                    var click = m_JarResolverLink.DrawWithCalcSize();
                    if (click)
                    {
                        Application.OpenURL(JAR_RESOLVER_DOC_LINK);
                    }
                }
            }

            using (new SA_WindowBlockWithSpace("Storage"))
            {
                EditorGUILayout.HelpBox("When plugin needs to have a valid URI for an image, " +
                                        "it can be saved using the Internal or External storage. " +
                                        "In case saving attempt is failed, an alternative option will be used. " +
                                        "You can define if Internal or External storage should be a preferred option.",
                                        MessageType.Info);
                AN_Settings.Instance.PreferredImagesStorage = (AN_Settings.StorageType)SA_EditorGUILayout.EnumPopup("Preferred Images Storage", AN_Settings.Instance.PreferredImagesStorage);
                using (new SA_GuiBeginHorizontal())
                {
                    GUILayout.FlexibleSpace();
                    var click = m_StorageOptionsLink.DrawWithCalcSize();
                    if (click)
                    {
                        Application.OpenURL(STORAGE_OPTIONS_DOC_LINK);
                    }
                }
            }


            using (new SA_WindowBlockWithSpace("Debug"))
            {
                EditorGUILayout.HelpBox("API Resolver's are normally launched with build pre-process stage", MessageType.Info);
                var pressed = GUILayout.Button("Start API Resolvers");
                if (pressed)
                {
                    SA_PluginsEditor.DisableLibstAtPath(AN_Settings.ANDROID_FOLDER_DISABLED);
                    AN_Preprocessor.Resolve();
                    GUIUtility.ExitGUI();
                }

                EditorGUILayout.HelpBox("Action will reset all of the plugin settings to default.", MessageType.Info);
                pressed = GUILayout.Button("Reset To Defaults");
                if (pressed)
                {
                    AN_Settings.Delete();
                    AN_Preprocessor.Resolve();
                }
            }
        }
        protected override void OnServiceUI()
        {
            using (new SA_WindowBlockWithSpace(new GUIContent("Configuration"))) {
                string setResourceName = "Update Game Resource";
                if (AN_GoolgePlayRersources.GamesIds == null)
                {
                    EditorGUILayout.HelpBox("Before you start using Google Play API with the plugin" +
                                            "You must first configure your game in the Google Play Developer Console, " +
                                            "and then define google play resources using the plugin.",
                                            MessageType.Warning);
                    using (new SA_GuiBeginHorizontal()) {
                        GUILayout.FlexibleSpace();
                        bool click = m_configureYourGameLink.DrawWithCalcSize();
                        if (click)
                        {
                            Application.OpenURL("https://unionassets.com/android-native-pro/getting-started-670");
                        }
                    }

                    setResourceName = "Set Game Resource";
                }
                else
                {
                    string applicationIdentifier = PlayerSettings.GetApplicationIdentifier(BuildTargetGroup.Android);
                    if (!applicationIdentifier.Equals(AN_GoolgePlayRersources.GamesIds.PackageName))
                    {
                        EditorGUILayout.HelpBox("Player Settings Package Name does not match with " +
                                                "Android Games Package Name \n" +
                                                "unity: " + applicationIdentifier + "\n" +
                                                "games-ids.xml: " + AN_GoolgePlayRersources.GamesIds.PackageName,
                                                MessageType.Warning);
                    }
                    using (new SA_GuiBeginVertical(EditorStyles.helpBox)) {
                        SA_EditorGUILayout.SelectableLabel("App Id", AN_GoolgePlayRersources.GamesIds.AppId);
                        SA_EditorGUILayout.SelectableLabel("Package Name", AN_GoolgePlayRersources.GamesIds.PackageName);

                        m_achievmentsShown = EditorGUILayout.Foldout(m_achievmentsShown, "Achievments");
                        if (m_achievmentsShown)
                        {
                            if (AN_GoolgePlayRersources.GamesIds.Achievements.Count > 0)
                            {
                                AN_GoolgePlayRersources.GamesIds.Achievements.ForEach(pair => {
                                    SA_EditorGUILayout.SelectableLabel(pair.Key, pair.Value);
                                });
                            }
                            else
                            {
                                EditorGUILayout.LabelField("There are no achievments in games-ids.xml");
                            }
                        }

                        m_leaderboardsShown = EditorGUILayout.Foldout(m_leaderboardsShown, "Leaderboards");
                        if (m_leaderboardsShown)
                        {
                            if (AN_GoolgePlayRersources.GamesIds.Leaderboards.Count > 0)
                            {
                                AN_GoolgePlayRersources.GamesIds.Leaderboards.ForEach(pair => {
                                    SA_EditorGUILayout.SelectableLabel(pair.Key, pair.Value);
                                });
                            }
                            else
                            {
                                EditorGUILayout.LabelField("There are no leaderboards in games-ids.xml");
                            }
                        }
                    }
                }

                using (new SA_GuiBeginHorizontal()) {
                    GUILayout.FlexibleSpace();
                    m_setResource.Content.text = setResourceName;
                    bool click = m_setResource.DrawWithCalcSize();
                    if (click)
                    {
                        AN_GoolgePlayRersourcesWindow.ShowModal();
                    }
                }
            }



            using (new SA_WindowBlockWithSpace(new GUIContent("Google Mobile Services APIs"))) {
                EditorGUILayout.HelpBox("In order to access Google Play games services functionality, " +
                                        "your game needs to provide the signed-in player’s account. If the player is not authenticated, " +
                                        "your game may encounter errors when making calls to the Google Play games services APIs.",
                                        MessageType.Info);


                using (new SA_GuiBeginHorizontal()) {
                    EditorGUILayout.LabelField(SingInLabelContent);
                    using (new SA_GuiEnable(false)) {
                        SA_EditorGUILayout.ToggleFiled(new GUIContent(), true, SA_StyledToggle.ToggleType.EnabledDisabled);
                    }
                }

                AN_Settings.Instance.GooglePlayGamesAPI = SA_EditorGUILayout.ToggleFiled(GamesLabelContent, AN_Settings.Instance.GooglePlayGamesAPI, SA_StyledToggle.ToggleType.EnabledDisabled);
            }
        }