Exemplo n.º 1
0
        public void OnGUI()
        {
            GUI.skin.label.wordWrap = true;
            GUILayout.BeginVertical(new GUILayoutOption[0]);
            GUILayout.BeginHorizontal(new GUILayoutOption[0]);
            GUILayout.Label("Podfile Generation", EditorStyles.boldLabel, new GUILayoutOption[0]);
            this.settings.podfileGenerationEnabled = EditorGUILayout.Toggle(this.settings.podfileGenerationEnabled, new GUILayoutOption[0]);
            GUILayout.EndHorizontal();
            GUILayout.Label("Podfile generation is required to install Cocoapods.  It may be desirable to disable Podfile generation if frameworks are manually included in Unity's generated Xcode project.", new GUILayoutOption[0]);
            GUILayout.BeginHorizontal(new GUILayoutOption[0]);
            GUILayout.Label("Cocoapods Integration", EditorStyles.boldLabel, new GUILayoutOption[0]);
            GUILayout.EndHorizontal();
            GUILayout.BeginHorizontal(new GUILayoutOption[0]);
            this.settings.cocoapodsIntegrationMenuIndex = EditorGUILayout.Popup(this.settings.cocoapodsIntegrationMenuIndex, IOSResolverSettingsDialog.cocopodsIntegrationStrings, new GUILayoutOption[0]);
            GUILayout.EndHorizontal();
            GUILayout.BeginHorizontal(new GUILayoutOption[0]);
            if (IOSResolverSettingsDialog.integrationMapping[this.settings.cocoapodsIntegrationMenuIndex] != IOSResolver.CocoapodsIntegrationMethod.None && !this.settings.podfileGenerationEnabled)
            {
                GUILayout.Label("Cocoapod installation requires Podfile generation to be enabled.", new GUILayoutOption[0]);
            }
            else if (IOSResolverSettingsDialog.integrationMapping[this.settings.cocoapodsIntegrationMenuIndex] == IOSResolver.CocoapodsIntegrationMethod.Workspace)
            {
                GUILayout.Label("Unity Cloud Build and Unity 5.5 and below do not open generated Xcode workspaces so this plugin will fall back to Xcode Project integration in those environments.", new GUILayoutOption[0]);
            }
            GUILayout.EndHorizontal();
            GUILayout.BeginHorizontal(new GUILayoutOption[0]);
            GUILayout.Label("Use Shell to Execute Cocoapod Tool", EditorStyles.boldLabel, new GUILayoutOption[0]);
            this.settings.podToolExecutionViaShellEnabled = EditorGUILayout.Toggle(this.settings.podToolExecutionViaShellEnabled, new GUILayoutOption[0]);
            GUILayout.EndHorizontal();
            if (this.settings.podToolExecutionViaShellEnabled)
            {
                GUILayout.Label("Shell execution is useful when configuration in the shell environment (e.g ~/.profile) is required to execute Cocoapods tools.", new GUILayoutOption[0]);
            }
            GUILayout.BeginHorizontal(new GUILayoutOption[0]);
            GUILayout.Label("Auto Install Cocoapod Tools in Editor", EditorStyles.boldLabel, new GUILayoutOption[0]);
            this.settings.autoPodToolInstallInEditorEnabled = EditorGUILayout.Toggle(this.settings.autoPodToolInstallInEditorEnabled, new GUILayoutOption[0]);
            GUILayout.EndHorizontal();
            if (this.settings.autoPodToolInstallInEditorEnabled)
            {
                GUILayout.Label("Automatically installs the Cocoapod tool if the editor isn't running in batch mode", new GUILayoutOption[0]);
            }
            else
            {
                GUILayout.Label("Cocoapod tool installation can be performed via the menu option: Assets > Play Services Resolver > iOS Resolver > Install Cocoapods", new GUILayoutOption[0]);
            }
            GUILayout.BeginHorizontal(new GUILayoutOption[0]);
            GUILayout.Label("Verbose Logging", EditorStyles.boldLabel, new GUILayoutOption[0]);
            this.settings.verboseLoggingEnabled = EditorGUILayout.Toggle(this.settings.verboseLoggingEnabled, new GUILayoutOption[0]);
            GUILayout.EndHorizontal();
            GUILayout.BeginHorizontal(new GUILayoutOption[0]);
            GUILayout.Label("Use project settings", EditorStyles.boldLabel, new GUILayoutOption[0]);
            this.settings.useProjectSettings = EditorGUILayout.Toggle(this.settings.useProjectSettings, new GUILayoutOption[0]);
            GUILayout.EndHorizontal();
            GUILayout.Space(10f);
            if (GUILayout.Button("Reset to Defaults", new GUILayoutOption[0]))
            {
                IOSResolverSettingsDialog.Settings settings = new IOSResolverSettingsDialog.Settings();
                IOSResolver.RestoreDefaultSettings();
                this.LoadSettings();
                settings.Save();
            }
            GUILayout.BeginHorizontal(new GUILayoutOption[0]);
            bool flag  = GUILayout.Button("Cancel", new GUILayoutOption[0]);
            bool flag2 = GUILayout.Button("OK", new GUILayoutOption[0]);

            flag |= flag2;
            if (flag2)
            {
                this.settings.Save();
            }
            if (flag)
            {
                base.Close();
            }
            GUILayout.EndHorizontal();
            GUILayout.EndVertical();
        }
Exemplo n.º 2
0
 private void LoadSettings()
 {
     this.settings = new IOSResolverSettingsDialog.Settings();
 }