Пример #1
0
        private void SetVersionControlSystem(object data)
        {
            int index = (int)data;

            if (index < 0 && index >= this.vcPopupList.Length)
            {
                return;
            }
            EditorSettingsInspector.PopupElement vcPopup = this.vcPopupList[index];
            string externalVersionControl = EditorSettings.externalVersionControl;

            EditorSettings.externalVersionControl = vcPopup.content.text;
            Provider.UpdateSettings();
            AssetDatabase.Refresh();
            if (!(externalVersionControl != vcPopup.content.text))
            {
                return;
            }
            if (vcPopup.content.text == ExternalVersionControl.AssetServer || vcPopup.content.text == ExternalVersionControl.Disabled || vcPopup.content.text == ExternalVersionControl.Generic)
            {
                WindowPending.CloseAllWindows();
            }
            else
            {
                ASMainWindow[] objectsOfTypeAll = Resources.FindObjectsOfTypeAll(typeof(ASMainWindow)) as ASMainWindow[];
                ASMainWindow   asMainWindow     = objectsOfTypeAll.Length <= 0 ? (ASMainWindow)null : objectsOfTypeAll[0];
                if (!((UnityEngine.Object)asMainWindow != (UnityEngine.Object)null))
                {
                    return;
                }
                asMainWindow.Close();
            }
        }
Пример #2
0
        private void SetVersionControlSystem(object data)
        {
            int num = (int)data;

            if (num < 0 && num >= this.vcPopupList.Length)
            {
                return;
            }
            EditorSettingsInspector.PopupElement popupElement = this.vcPopupList[num];
            string externalVersionControl = EditorSettings.externalVersionControl;

            EditorSettings.externalVersionControl = popupElement.content.text;
            Provider.UpdateSettings();
            AssetDatabase.Refresh();
            if (externalVersionControl != popupElement.content.text)
            {
                if (popupElement.content.text == ExternalVersionControl.AssetServer || popupElement.content.text == ExternalVersionControl.Disabled || popupElement.content.text == ExternalVersionControl.Generic)
                {
                    WindowPending.CloseAllWindows();
                }
                else
                {
                    ASMainWindow[] array        = Resources.FindObjectsOfTypeAll(typeof(ASMainWindow)) as ASMainWindow[];
                    ASMainWindow   aSMainWindow = (array.Length <= 0) ? null : array[0];
                    if (aSMainWindow != null)
                    {
                        aSMainWindow.Close();
                    }
                }
            }
        }
        private void SetVersionControlSystem(object data)
        {
            int popupIndex = (int)data;

            if (popupIndex < 0 || popupIndex >= vcPopupList.Length)
            {
                return;
            }

            EditorSettingsInspector.PopupElement el = vcPopupList[popupIndex];
            string oldVC = VersionControlSettings.mode;

            VersionControlSettings.mode = el.id;
            Provider.UpdateSettings();
            AssetDatabase.Refresh();

            if (oldVC != el.id)
            {
                if (el.content.text == ExternalVersionControl.Disabled ||
                    el.content.text == ExternalVersionControl.Generic
                    )
                {
                    // Close the normal version control window
                    WindowPending.CloseAllWindows();
                }
            }
        }
Пример #4
0
        private void DoPopup(Rect popupRect, EditorSettingsInspector.PopupElement[] elements, int selectedIndex, GenericMenu.MenuFunction2 func)
        {
            GenericMenu genericMenu = new GenericMenu();

            for (int i = 0; i < elements.Length; i++)
            {
                EditorSettingsInspector.PopupElement popupElement = elements[i];
                if (popupElement.Enabled)
                {
                    genericMenu.AddItem(popupElement.content, i == selectedIndex, func, i);
                }
                else
                {
                    genericMenu.AddDisabledItem(popupElement.content);
                }
            }
            genericMenu.DropDown(popupRect);
        }
Пример #5
0
        private void SetVersionControlSystem(object data)
        {
            int num = (int)data;

            if (num >= 0 || num < this.vcPopupList.Length)
            {
                EditorSettingsInspector.PopupElement popupElement = this.vcPopupList[num];
                string externalVersionControl = EditorSettings.externalVersionControl;
                EditorSettings.externalVersionControl = popupElement.id;
                Provider.UpdateSettings();
                AssetDatabase.Refresh();
                if (externalVersionControl != popupElement.id)
                {
                    if (popupElement.content.text == ExternalVersionControl.Disabled || popupElement.content.text == ExternalVersionControl.Generic)
                    {
                        WindowPending.CloseAllWindows();
                    }
                }
            }
        }
Пример #6
0
 public PopupElement(string content)
 {
     this = new EditorSettingsInspector.PopupElement(content, false);
 }
 public PopupElement(string content)
 {
   this = new EditorSettingsInspector.PopupElement(content, false);
 }