예제 #1
0
        public override void OnInspectorGUI()
        {
            // ISSUE: object of a compiler-generated type is created
            // ISSUE: variable of a compiler-generated type
            EditorSettingsInspector.\u003COnInspectorGUI\u003Ec__AnonStorey8F guICAnonStorey8F = new EditorSettingsInspector.\u003COnInspectorGUI\u003Ec__AnonStorey8F();
            bool enabled = GUI.enabled;

            this.ShowUnityRemoteGUI(enabled);
            GUILayout.Space(10f);
            GUI.enabled = true;
            GUILayout.Label("Version Control", EditorStyles.boldLabel, new GUILayoutOption[0]);
            GUI.enabled = enabled;
            // ISSUE: reference to a compiler-generated field
            guICAnonStorey8F.selvc = (ExternalVersionControl)EditorSettings.externalVersionControl;
            // ISSUE: reference to a compiler-generated method
            int selectedIndex1 = Array.FindIndex <EditorSettingsInspector.PopupElement>(this.vcPopupList, new Predicate <EditorSettingsInspector.PopupElement>(guICAnonStorey8F.\u003C\u003Em__15E));

            if (selectedIndex1 < 0)
            {
                selectedIndex1 = 0;
            }
            GUIContent content1 = new GUIContent(this.vcPopupList[selectedIndex1].content);
            Rect       rect1    = EditorGUI.PrefixLabel(GUILayoutUtility.GetRect(content1, EditorStyles.popup), 0, new GUIContent("Mode"));

            if (EditorGUI.ButtonMouseDown(rect1, content1, FocusType.Passive, EditorStyles.popup))
            {
                this.DoPopup(rect1, this.vcPopupList, selectedIndex1, new GenericMenu.MenuFunction2(this.SetVersionControlSystem));
            }
            if (this.VersionControlSystemHasGUI())
            {
                // ISSUE: object of a compiler-generated type is created
                // ISSUE: variable of a compiler-generated type
                EditorSettingsInspector.\u003COnInspectorGUI\u003Ec__AnonStorey90 guICAnonStorey90 = new EditorSettingsInspector.\u003COnInspectorGUI\u003Ec__AnonStorey90();
                GUI.enabled = true;
                bool flag1 = false;
                if (EditorSettings.externalVersionControl == ExternalVersionControl.AssetServer)
                {
                    EditorUserSettings.SetConfigValue("vcUsername", EditorGUILayout.TextField("User", EditorUserSettings.GetConfigValue("vcUsername"), new GUILayoutOption[0]));
                    EditorUserSettings.SetConfigValue("vcPassword", EditorGUILayout.PasswordField("Password", EditorUserSettings.GetConfigValue("vcPassword"), new GUILayoutOption[0]));
                }
                else if (!(EditorSettings.externalVersionControl == ExternalVersionControl.Generic) && !(EditorSettings.externalVersionControl == ExternalVersionControl.Disabled))
                {
                    ConfigField[] activeConfigFields = Provider.GetActiveConfigFields();
                    flag1 = true;
                    foreach (ConfigField configField in activeConfigFields)
                    {
                        string configValue = EditorUserSettings.GetConfigValue(configField.name);
                        string str         = !configField.isPassword ? EditorGUILayout.TextField(configField.label, configValue, new GUILayoutOption[0]) : EditorGUILayout.PasswordField(configField.label, configValue, new GUILayoutOption[0]);
                        if (str != configValue)
                        {
                            EditorUserSettings.SetConfigValue(configField.name, str);
                        }
                        if (configField.isRequired && string.IsNullOrEmpty(str))
                        {
                            flag1 = false;
                        }
                    }
                }
                // ISSUE: reference to a compiler-generated field
                guICAnonStorey90.logLevel = EditorUserSettings.GetConfigValue("vcSharedLogLevel");
                // ISSUE: reference to a compiler-generated method
                int index1 = Array.FindIndex <string>(this.logLevelPopupList, new Predicate <string>(guICAnonStorey90.\u003C\u003Em__15F));
                if (index1 == -1)
                {
                    // ISSUE: reference to a compiler-generated field
                    guICAnonStorey90.logLevel = "info";
                }
                int index2 = EditorGUILayout.Popup("Log Level", Math.Abs(index1), this.logLevelPopupList, new GUILayoutOption[0]);
                if (index2 != index1)
                {
                    EditorUserSettings.SetConfigValue("vcSharedLogLevel", this.logLevelPopupList[index2].ToLower());
                }
                GUI.enabled = enabled;
                string label2 = "Connected";
                if (Provider.onlineState == OnlineState.Updating)
                {
                    label2 = "Connecting...";
                }
                else if (Provider.onlineState == OnlineState.Offline)
                {
                    label2 = "Disconnected";
                }
                EditorGUILayout.LabelField("Status", label2, new GUILayoutOption[0]);
                if (Provider.onlineState != OnlineState.Online && !string.IsNullOrEmpty(Provider.offlineReason))
                {
                    GUI.enabled = false;
                    GUILayout.TextArea(Provider.offlineReason);
                    GUI.enabled = enabled;
                }
                GUILayout.BeginHorizontal();
                GUILayout.FlexibleSpace();
                GUI.enabled = flag1;
                if (GUILayout.Button("Connect", EditorStyles.miniButton, new GUILayoutOption[0]))
                {
                    Provider.UpdateSettings();
                }
                GUILayout.EndHorizontal();
                EditorUserSettings.AutomaticAdd = EditorGUILayout.Toggle("Automatic add", EditorUserSettings.AutomaticAdd, new GUILayoutOption[0]);
                if (Provider.requiresNetwork)
                {
                    bool flag2 = EditorGUILayout.Toggle("Work Offline", EditorUserSettings.WorkOffline, new GUILayoutOption[0]);
                    if (flag2 != EditorUserSettings.WorkOffline)
                    {
                        if (flag2 && !EditorUtility.DisplayDialog("Confirm working offline", "Working offline and making changes to your assets means that you will have to manually integrate changes back into version control using your standard version control client before you stop working offline in Unity. Make sure you know what you are doing.", "Work offline", "Cancel"))
                        {
                            flag2 = false;
                        }
                        EditorUserSettings.WorkOffline = flag2;
                        EditorApplication.RequestRepaintAllViews();
                    }
                }
                if (Provider.hasCheckoutSupport)
                {
                    EditorUserSettings.showFailedCheckout = EditorGUILayout.Toggle("Show failed checkouts", EditorUserSettings.showFailedCheckout, new GUILayoutOption[0]);
                }
                GUI.enabled = enabled;
                EditorUserSettings.semanticMergeMode = (SemanticMergeMode)EditorGUILayout.Popup("Smart merge", (int)EditorUserSettings.semanticMergeMode, this.semanticMergePopupList, new GUILayoutOption[0]);
                this.DrawOverlayDescriptions();
            }
            GUILayout.Space(10f);
            GUILayout.Label("WWW Security Emulation", EditorStyles.boldLabel, new GUILayoutOption[0]);
            EditorSettings.webSecurityEmulationEnabled = EditorGUILayout.Toggle("Enable Webplayer Security Emulation", EditorSettings.webSecurityEmulationEnabled, new GUILayoutOption[0]);
            string str1 = EditorGUILayout.TextField("Host URL", EditorSettings.webSecurityEmulationHostUrl, new GUILayoutOption[0]);

            if (str1 != EditorSettings.webSecurityEmulationHostUrl)
            {
                EditorSettings.webSecurityEmulationHostUrl = str1;
            }
            GUILayout.Space(10f);
            GUI.enabled = true;
            GUILayout.Label("Asset Serialization", EditorStyles.boldLabel, new GUILayoutOption[0]);
            GUI.enabled = enabled;
            GUIContent content2 = new GUIContent(this.serializationPopupList[(int)EditorSettings.serializationMode].content);
            Rect       rect2    = EditorGUI.PrefixLabel(GUILayoutUtility.GetRect(content2, EditorStyles.popup), 0, new GUIContent("Mode"));

            if (EditorGUI.ButtonMouseDown(rect2, content2, FocusType.Passive, EditorStyles.popup))
            {
                this.DoPopup(rect2, this.serializationPopupList, (int)EditorSettings.serializationMode, new GenericMenu.MenuFunction2(this.SetAssetSerializationMode));
            }
            GUILayout.Space(10f);
            GUI.enabled = true;
            GUILayout.Label("Default Behavior Mode", EditorStyles.boldLabel, new GUILayoutOption[0]);
            GUI.enabled = enabled;
            int        selectedIndex2 = Mathf.Clamp((int)EditorSettings.defaultBehaviorMode, 0, this.behaviorPopupList.Length - 1);
            GUIContent content3       = new GUIContent(this.behaviorPopupList[selectedIndex2].content);
            Rect       rect3          = EditorGUI.PrefixLabel(GUILayoutUtility.GetRect(content3, EditorStyles.popup), 0, new GUIContent("Mode"));

            if (EditorGUI.ButtonMouseDown(rect3, content3, FocusType.Passive, EditorStyles.popup))
            {
                this.DoPopup(rect3, this.behaviorPopupList, selectedIndex2, new GenericMenu.MenuFunction2(this.SetDefaultBehaviorMode));
            }
            GUILayout.Space(10f);
            GUI.enabled = true;
            GUILayout.Label("Sprite Packer", EditorStyles.boldLabel, new GUILayoutOption[0]);
            GUI.enabled = enabled;
            int        selectedIndex3 = Mathf.Clamp((int)EditorSettings.spritePackerMode, 0, this.spritePackerPopupList.Length - 1);
            GUIContent content4       = new GUIContent(this.spritePackerPopupList[selectedIndex3].content);
            Rect       rect4          = EditorGUI.PrefixLabel(GUILayoutUtility.GetRect(content4, EditorStyles.popup), 0, new GUIContent("Mode"));

            if (EditorGUI.ButtonMouseDown(rect4, content4, FocusType.Passive, EditorStyles.popup))
            {
                this.DoPopup(rect4, this.spritePackerPopupList, selectedIndex3, new GenericMenu.MenuFunction2(this.SetSpritePackerMode));
            }
            int        selectedIndex4 = Mathf.Clamp(EditorSettings.spritePackerPaddingPower - 1, 0, 2);
            GUIContent content5       = new GUIContent(this.spritePackerPaddingPowerPopupList[selectedIndex4].content);
            Rect       rect5          = EditorGUI.PrefixLabel(GUILayoutUtility.GetRect(content5, EditorStyles.popup), 0, new GUIContent("Padding Power"));

            if (EditorGUI.ButtonMouseDown(rect5, content5, FocusType.Passive, EditorStyles.popup))
            {
                this.DoPopup(rect5, this.spritePackerPaddingPowerPopupList, selectedIndex4, new GenericMenu.MenuFunction2(this.SetSpritePackerPaddingPower));
            }
            this.DoProjectGenerationSettings();
        }
 public override void OnInspectorGUI()
 {
   // ISSUE: object of a compiler-generated type is created
   // ISSUE: variable of a compiler-generated type
   EditorSettingsInspector.\u003COnInspectorGUI\u003Ec__AnonStorey8F guICAnonStorey8F = new EditorSettingsInspector.\u003COnInspectorGUI\u003Ec__AnonStorey8F();
   bool enabled = GUI.enabled;
   this.ShowUnityRemoteGUI(enabled);
   GUILayout.Space(10f);
   GUI.enabled = true;
   GUILayout.Label("Version Control", EditorStyles.boldLabel, new GUILayoutOption[0]);
   GUI.enabled = enabled;
   // ISSUE: reference to a compiler-generated field
   guICAnonStorey8F.selvc = (ExternalVersionControl) EditorSettings.externalVersionControl;
   // ISSUE: reference to a compiler-generated method
   int selectedIndex1 = Array.FindIndex<EditorSettingsInspector.PopupElement>(this.vcPopupList, new Predicate<EditorSettingsInspector.PopupElement>(guICAnonStorey8F.\u003C\u003Em__15E));
   if (selectedIndex1 < 0)
     selectedIndex1 = 0;
   GUIContent content1 = new GUIContent(this.vcPopupList[selectedIndex1].content);
   Rect rect1 = EditorGUI.PrefixLabel(GUILayoutUtility.GetRect(content1, EditorStyles.popup), 0, new GUIContent("Mode"));
   if (EditorGUI.ButtonMouseDown(rect1, content1, FocusType.Passive, EditorStyles.popup))
     this.DoPopup(rect1, this.vcPopupList, selectedIndex1, new GenericMenu.MenuFunction2(this.SetVersionControlSystem));
   if (this.VersionControlSystemHasGUI())
   {
     // ISSUE: object of a compiler-generated type is created
     // ISSUE: variable of a compiler-generated type
     EditorSettingsInspector.\u003COnInspectorGUI\u003Ec__AnonStorey90 guICAnonStorey90 = new EditorSettingsInspector.\u003COnInspectorGUI\u003Ec__AnonStorey90();
     GUI.enabled = true;
     bool flag1 = false;
     if (EditorSettings.externalVersionControl == ExternalVersionControl.AssetServer)
     {
       EditorUserSettings.SetConfigValue("vcUsername", EditorGUILayout.TextField("User", EditorUserSettings.GetConfigValue("vcUsername"), new GUILayoutOption[0]));
       EditorUserSettings.SetConfigValue("vcPassword", EditorGUILayout.PasswordField("Password", EditorUserSettings.GetConfigValue("vcPassword"), new GUILayoutOption[0]));
     }
     else if (!(EditorSettings.externalVersionControl == ExternalVersionControl.Generic) && !(EditorSettings.externalVersionControl == ExternalVersionControl.Disabled))
     {
       ConfigField[] activeConfigFields = Provider.GetActiveConfigFields();
       flag1 = true;
       foreach (ConfigField configField in activeConfigFields)
       {
         string configValue = EditorUserSettings.GetConfigValue(configField.name);
         string str = !configField.isPassword ? EditorGUILayout.TextField(configField.label, configValue, new GUILayoutOption[0]) : EditorGUILayout.PasswordField(configField.label, configValue, new GUILayoutOption[0]);
         if (str != configValue)
           EditorUserSettings.SetConfigValue(configField.name, str);
         if (configField.isRequired && string.IsNullOrEmpty(str))
           flag1 = false;
       }
     }
     // ISSUE: reference to a compiler-generated field
     guICAnonStorey90.logLevel = EditorUserSettings.GetConfigValue("vcSharedLogLevel");
     // ISSUE: reference to a compiler-generated method
     int index1 = Array.FindIndex<string>(this.logLevelPopupList, new Predicate<string>(guICAnonStorey90.\u003C\u003Em__15F));
     if (index1 == -1)
     {
       // ISSUE: reference to a compiler-generated field
       guICAnonStorey90.logLevel = "info";
     }
     int index2 = EditorGUILayout.Popup("Log Level", Math.Abs(index1), this.logLevelPopupList, new GUILayoutOption[0]);
     if (index2 != index1)
       EditorUserSettings.SetConfigValue("vcSharedLogLevel", this.logLevelPopupList[index2].ToLower());
     GUI.enabled = enabled;
     string label2 = "Connected";
     if (Provider.onlineState == OnlineState.Updating)
       label2 = "Connecting...";
     else if (Provider.onlineState == OnlineState.Offline)
       label2 = "Disconnected";
     EditorGUILayout.LabelField("Status", label2, new GUILayoutOption[0]);
     if (Provider.onlineState != OnlineState.Online && !string.IsNullOrEmpty(Provider.offlineReason))
     {
       GUI.enabled = false;
       GUILayout.TextArea(Provider.offlineReason);
       GUI.enabled = enabled;
     }
     GUILayout.BeginHorizontal();
     GUILayout.FlexibleSpace();
     GUI.enabled = flag1;
     if (GUILayout.Button("Connect", EditorStyles.miniButton, new GUILayoutOption[0]))
       Provider.UpdateSettings();
     GUILayout.EndHorizontal();
     EditorUserSettings.AutomaticAdd = EditorGUILayout.Toggle("Automatic add", EditorUserSettings.AutomaticAdd, new GUILayoutOption[0]);
     if (Provider.requiresNetwork)
     {
       bool flag2 = EditorGUILayout.Toggle("Work Offline", EditorUserSettings.WorkOffline, new GUILayoutOption[0]);
       if (flag2 != EditorUserSettings.WorkOffline)
       {
         if (flag2 && !EditorUtility.DisplayDialog("Confirm working offline", "Working offline and making changes to your assets means that you will have to manually integrate changes back into version control using your standard version control client before you stop working offline in Unity. Make sure you know what you are doing.", "Work offline", "Cancel"))
           flag2 = false;
         EditorUserSettings.WorkOffline = flag2;
         EditorApplication.RequestRepaintAllViews();
       }
     }
     if (Provider.hasCheckoutSupport)
       EditorUserSettings.showFailedCheckout = EditorGUILayout.Toggle("Show failed checkouts", EditorUserSettings.showFailedCheckout, new GUILayoutOption[0]);
     GUI.enabled = enabled;
     EditorUserSettings.semanticMergeMode = (SemanticMergeMode) EditorGUILayout.Popup("Smart merge", (int) EditorUserSettings.semanticMergeMode, this.semanticMergePopupList, new GUILayoutOption[0]);
     this.DrawOverlayDescriptions();
   }
   GUILayout.Space(10f);
   GUILayout.Label("WWW Security Emulation", EditorStyles.boldLabel, new GUILayoutOption[0]);
   EditorSettings.webSecurityEmulationEnabled = EditorGUILayout.Toggle("Enable Webplayer Security Emulation", EditorSettings.webSecurityEmulationEnabled, new GUILayoutOption[0]);
   string str1 = EditorGUILayout.TextField("Host URL", EditorSettings.webSecurityEmulationHostUrl, new GUILayoutOption[0]);
   if (str1 != EditorSettings.webSecurityEmulationHostUrl)
     EditorSettings.webSecurityEmulationHostUrl = str1;
   GUILayout.Space(10f);
   GUI.enabled = true;
   GUILayout.Label("Asset Serialization", EditorStyles.boldLabel, new GUILayoutOption[0]);
   GUI.enabled = enabled;
   GUIContent content2 = new GUIContent(this.serializationPopupList[(int) EditorSettings.serializationMode].content);
   Rect rect2 = EditorGUI.PrefixLabel(GUILayoutUtility.GetRect(content2, EditorStyles.popup), 0, new GUIContent("Mode"));
   if (EditorGUI.ButtonMouseDown(rect2, content2, FocusType.Passive, EditorStyles.popup))
     this.DoPopup(rect2, this.serializationPopupList, (int) EditorSettings.serializationMode, new GenericMenu.MenuFunction2(this.SetAssetSerializationMode));
   GUILayout.Space(10f);
   GUI.enabled = true;
   GUILayout.Label("Default Behavior Mode", EditorStyles.boldLabel, new GUILayoutOption[0]);
   GUI.enabled = enabled;
   int selectedIndex2 = Mathf.Clamp((int) EditorSettings.defaultBehaviorMode, 0, this.behaviorPopupList.Length - 1);
   GUIContent content3 = new GUIContent(this.behaviorPopupList[selectedIndex2].content);
   Rect rect3 = EditorGUI.PrefixLabel(GUILayoutUtility.GetRect(content3, EditorStyles.popup), 0, new GUIContent("Mode"));
   if (EditorGUI.ButtonMouseDown(rect3, content3, FocusType.Passive, EditorStyles.popup))
     this.DoPopup(rect3, this.behaviorPopupList, selectedIndex2, new GenericMenu.MenuFunction2(this.SetDefaultBehaviorMode));
   GUILayout.Space(10f);
   GUI.enabled = true;
   GUILayout.Label("Sprite Packer", EditorStyles.boldLabel, new GUILayoutOption[0]);
   GUI.enabled = enabled;
   int selectedIndex3 = Mathf.Clamp((int) EditorSettings.spritePackerMode, 0, this.spritePackerPopupList.Length - 1);
   GUIContent content4 = new GUIContent(this.spritePackerPopupList[selectedIndex3].content);
   Rect rect4 = EditorGUI.PrefixLabel(GUILayoutUtility.GetRect(content4, EditorStyles.popup), 0, new GUIContent("Mode"));
   if (EditorGUI.ButtonMouseDown(rect4, content4, FocusType.Passive, EditorStyles.popup))
     this.DoPopup(rect4, this.spritePackerPopupList, selectedIndex3, new GenericMenu.MenuFunction2(this.SetSpritePackerMode));
   int selectedIndex4 = Mathf.Clamp(EditorSettings.spritePackerPaddingPower - 1, 0, 2);
   GUIContent content5 = new GUIContent(this.spritePackerPaddingPowerPopupList[selectedIndex4].content);
   Rect rect5 = EditorGUI.PrefixLabel(GUILayoutUtility.GetRect(content5, EditorStyles.popup), 0, new GUIContent("Padding Power"));
   if (EditorGUI.ButtonMouseDown(rect5, content5, FocusType.Passive, EditorStyles.popup))
     this.DoPopup(rect5, this.spritePackerPaddingPowerPopupList, selectedIndex4, new GenericMenu.MenuFunction2(this.SetSpritePackerPaddingPower));
   this.DoProjectGenerationSettings();
 }