Exemplo n.º 1
0
        private void OnGUI()
        {
            if (PragmaFixingWindow.s_Styles == null)
            {
                PragmaFixingWindow.s_Styles = new PragmaFixingWindow.Styles();
                base.minSize  = new Vector2(450f, 300f);
                base.position = new Rect(base.position.x, base.position.y, base.minSize.x, base.minSize.y);
            }
            GUILayout.Space(10f);
            GUILayout.Label("#pragma implicit and #pragma downcast need to be added to following files\nfor backwards compatibility", new GUILayoutOption[0]);
            GUILayout.Space(10f);
            GUILayout.BeginHorizontal(new GUILayoutOption[0]);
            GUILayout.Space(10f);
            IEnumerator enumerator = ListViewGUILayout.ListView(this.m_LV, PragmaFixingWindow.s_Styles.box, new GUILayoutOption[0]).GetEnumerator();

            try
            {
                while (enumerator.MoveNext())
                {
                    ListViewElement listViewElement = (ListViewElement)enumerator.Current;
                    if (listViewElement.row == this.m_LV.row && Event.current.type == EventType.Repaint)
                    {
                        PragmaFixingWindow.s_Styles.selected.Draw(listViewElement.position, false, false, false, false);
                    }
                    GUILayout.Label(this.m_Paths[listViewElement.row], new GUILayoutOption[0]);
                }
            }
            finally
            {
                IDisposable disposable;
                if ((disposable = (enumerator as IDisposable)) != null)
                {
                    disposable.Dispose();
                }
            }
            GUILayout.Space(10f);
            GUILayout.EndHorizontal();
            GUILayout.Space(10f);
            GUILayout.BeginHorizontal(new GUILayoutOption[0]);
            GUILayout.FlexibleSpace();
            if (GUILayout.Button("Fix now", PragmaFixingWindow.s_Styles.button, new GUILayoutOption[0]))
            {
                base.Close();
                PragmaFixing30.FixFiles(this.m_Paths);
                GUIUtility.ExitGUI();
            }
            if (GUILayout.Button("Ignore", PragmaFixingWindow.s_Styles.button, new GUILayoutOption[0]))
            {
                base.Close();
                GUIUtility.ExitGUI();
            }
            if (GUILayout.Button("Quit", PragmaFixingWindow.s_Styles.button, new GUILayoutOption[0]))
            {
                EditorApplication.Exit(0);
                GUIUtility.ExitGUI();
            }
            GUILayout.Space(10f);
            GUILayout.EndHorizontal();
            GUILayout.Space(10f);
        }
Exemplo n.º 2
0
        void OnGUI()
        {
            if (s_Styles == null)
            {
                s_Styles = new Styles();
                minSize  = new Vector2(450, 300);
                position = new Rect(position.x, position.y, minSize.x, minSize.y);
            }

            GUILayout.Space(10);
            GUILayout.Label("#pragma implicit and #pragma downcast need to be added to following files\nfor backwards compatibility");
            GUILayout.Space(10);

            GUILayout.BeginHorizontal();
            GUILayout.Space(10);
            foreach (ListViewElement el in ListViewGUILayout.ListView(m_LV, s_Styles.box))
            {
                if (el.row == m_LV.row && Event.current.type == EventType.Repaint)
                {
                    s_Styles.selected.Draw(el.position, false, false, false, false);
                }

                GUILayout.Label(m_Paths[el.row]);
            }
            GUILayout.Space(10);
            GUILayout.EndHorizontal();
            GUILayout.Space(10);

            GUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            if (GUILayout.Button("Fix now", s_Styles.button))
            {
                Close();
                PragmaFixing30.FixFiles(m_Paths);
                // bugfix (377429): do not call AssetDatabase.Refresh here as that screws up project upgrading.
                // When this script is invoked from Application::InitializeProject, the assets will be refreshed anyway.
                GUIUtility.ExitGUI();
            }

            if (GUILayout.Button("Ignore", s_Styles.button))
            {
                Close();
                GUIUtility.ExitGUI();
            }

            if (GUILayout.Button("Quit", s_Styles.button))
            {
                EditorApplication.Exit(0);
                GUIUtility.ExitGUI();
            }

            GUILayout.Space(10);
            GUILayout.EndHorizontal();

            GUILayout.Space(10);
        }
 private void OnGUI()
 {
     if (PragmaFixingWindow.s_Styles == null)
     {
         PragmaFixingWindow.s_Styles = new PragmaFixingWindow.Styles();
         this.minSize  = new Vector2(450f, 300f);
         this.position = new Rect(this.position.x, this.position.y, this.minSize.x, this.minSize.y);
     }
     GUILayout.Space(10f);
     GUILayout.Label("#pragma implicit and #pragma downcast need to be added to following files\nfor backwards compatibility");
     GUILayout.Space(10f);
     GUILayout.BeginHorizontal();
     GUILayout.Space(10f);
     foreach (ListViewElement listViewElement in ListViewGUILayout.ListView(this.m_LV, PragmaFixingWindow.s_Styles.box))
     {
         if (listViewElement.row == this.m_LV.row && Event.current.type == EventType.Repaint)
         {
             PragmaFixingWindow.s_Styles.selected.Draw(listViewElement.position, false, false, false, false);
         }
         GUILayout.Label(this.m_Paths[listViewElement.row]);
     }
     GUILayout.Space(10f);
     GUILayout.EndHorizontal();
     GUILayout.Space(10f);
     GUILayout.BeginHorizontal();
     GUILayout.FlexibleSpace();
     if (GUILayout.Button("Fix now", PragmaFixingWindow.s_Styles.button, new GUILayoutOption[0]))
     {
         this.Close();
         PragmaFixing30.FixFiles(this.m_Paths);
         GUIUtility.ExitGUI();
     }
     if (GUILayout.Button("Ignore", PragmaFixingWindow.s_Styles.button, new GUILayoutOption[0]))
     {
         this.Close();
         GUIUtility.ExitGUI();
     }
     if (GUILayout.Button("Quit", PragmaFixingWindow.s_Styles.button, new GUILayoutOption[0]))
     {
         EditorApplication.Exit(0);
         GUIUtility.ExitGUI();
     }
     GUILayout.Space(10f);
     GUILayout.EndHorizontal();
     GUILayout.Space(10f);
 }