Esempio n. 1
0
 public static void SaveWindowLayout(string path)
 {
     TooltipView.Close();
     ArrayList list = new ArrayList();
     UnityEngine.Object[] objArray = UnityEngine.Resources.FindObjectsOfTypeAll(typeof(EditorWindow));
     UnityEngine.Object[] objArray2 = UnityEngine.Resources.FindObjectsOfTypeAll(typeof(ContainerWindow));
     UnityEngine.Object[] objArray3 = UnityEngine.Resources.FindObjectsOfTypeAll(typeof(View));
     foreach (ContainerWindow window in objArray2)
     {
         if (!window.m_DontSaveToLayout)
         {
             list.Add(window);
         }
     }
     foreach (View view in objArray3)
     {
         if ((view.window == null) || !view.window.m_DontSaveToLayout)
         {
             list.Add(view);
         }
     }
     foreach (EditorWindow window2 in objArray)
     {
         if (((window2.m_Parent == null) || (window2.m_Parent.window == null)) || !window2.m_Parent.window.m_DontSaveToLayout)
         {
             list.Add(window2);
         }
     }
     InternalEditorUtility.SaveToSerializedFileAndForget(list.ToArray(typeof(UnityEngine.Object)) as UnityEngine.Object[], path, false);
 }
Esempio n. 2
0
        public static void SaveWindowLayout(string path)
        {
            TooltipView.Close();
            ArrayList arrayList = new ArrayList();

            UnityEngine.Object[] objectsOfTypeAll1 = Resources.FindObjectsOfTypeAll(typeof(EditorWindow));
            UnityEngine.Object[] objectsOfTypeAll2 = Resources.FindObjectsOfTypeAll(typeof(ContainerWindow));
            UnityEngine.Object[] objectsOfTypeAll3 = Resources.FindObjectsOfTypeAll(typeof(View));
            foreach (ContainerWindow containerWindow in objectsOfTypeAll2)
            {
                if (!containerWindow.m_DontSaveToLayout)
                {
                    arrayList.Add((object)containerWindow);
                }
            }
            foreach (View view in objectsOfTypeAll3)
            {
                if (!((UnityEngine.Object)view.window != (UnityEngine.Object)null) || !view.window.m_DontSaveToLayout)
                {
                    arrayList.Add((object)view);
                }
            }
            foreach (EditorWindow editorWindow in objectsOfTypeAll1)
            {
                if (!((UnityEngine.Object)editorWindow.m_Parent != (UnityEngine.Object)null) || !((UnityEngine.Object)editorWindow.m_Parent.window != (UnityEngine.Object)null) || !editorWindow.m_Parent.window.m_DontSaveToLayout)
                {
                    arrayList.Add((object)editorWindow);
                }
            }
            InternalEditorUtility.SaveToSerializedFileAndForget(arrayList.ToArray(typeof(UnityEngine.Object)) as UnityEngine.Object[], path, false);
        }
 public static void Show(string tooltip, Rect rect)
 {
   if ((Object) TooltipView.s_guiView == (Object) null)
   {
     TooltipView.s_guiView = ScriptableObject.CreateInstance<TooltipView>();
     TooltipView.s_guiView.m_tooltipContainer = ScriptableObject.CreateInstance<ContainerWindow>();
     TooltipView.s_guiView.m_tooltipContainer.m_DontSaveToLayout = true;
     TooltipView.s_guiView.m_tooltipContainer.mainView = (View) TooltipView.s_guiView;
     TooltipView.s_guiView.m_tooltipContainer.SetMinMaxSizes(new Vector2(10f, 10f), new Vector2(2000f, 2000f));
   }
   if (TooltipView.s_guiView.m_tooltip.text == tooltip && rect == TooltipView.s_guiView.m_hoverRect)
     return;
   TooltipView.s_guiView.Setup(tooltip, rect);
 }
Esempio n. 4
0
 public static void CloseWindows()
 {
     try
     {
         TooltipView.Close();
     }
     catch (Exception)
     {
     }
     UnityEngine.Object[] array  = Resources.FindObjectsOfTypeAll(typeof(ContainerWindow));
     UnityEngine.Object[] array2 = array;
     for (int i = 0; i < array2.Length; i++)
     {
         ContainerWindow containerWindow = (ContainerWindow)array2[i];
         try
         {
             containerWindow.Close();
         }
         catch (Exception)
         {
         }
     }
     UnityEngine.Object[] array3 = Resources.FindObjectsOfTypeAll(typeof(EditorWindow));
     if (array3.Length != 0)
     {
         string text = "";
         UnityEngine.Object[] array4 = array3;
         for (int j = 0; j < array4.Length; j++)
         {
             EditorWindow editorWindow = (EditorWindow)array4[j];
             text = text + "\n" + editorWindow.GetType().Name;
             UnityEngine.Object.DestroyImmediate(editorWindow, true);
         }
         UnityEngine.Debug.LogError("Failed to destroy editor windows: #" + array3.Length + text);
     }
     UnityEngine.Object[] array5 = Resources.FindObjectsOfTypeAll(typeof(View));
     if (array5.Length != 0)
     {
         string text2 = "";
         UnityEngine.Object[] array6 = array5;
         for (int k = 0; k < array6.Length; k++)
         {
             View view = (View)array6[k];
             text2 = text2 + "\n" + view.GetType().Name;
             UnityEngine.Object.DestroyImmediate(view, true);
         }
         UnityEngine.Debug.LogError("Failed to destroy views: #" + array5.Length + text2);
     }
 }
Esempio n. 5
0
 public static void Show(string tooltip, Rect rect)
 {
     if (TooltipView.s_guiView == null)
     {
         TooltipView.s_guiView = ScriptableObject.CreateInstance <TooltipView>();
         TooltipView.s_guiView.m_tooltipContainer = ScriptableObject.CreateInstance <ContainerWindow>();
         TooltipView.s_guiView.m_tooltipContainer.m_DontSaveToLayout = true;
         TooltipView.s_guiView.m_tooltipContainer.rootView           = TooltipView.s_guiView;
         TooltipView.s_guiView.m_tooltipContainer.SetMinMaxSizes(new Vector2(10f, 10f), new Vector2(2000f, 2000f));
     }
     if (!(TooltipView.s_guiView.m_tooltip.text == tooltip) || !(rect == TooltipView.s_guiView.m_hoverRect))
     {
         TooltipView.s_guiView.Setup(tooltip, rect);
     }
 }
Esempio n. 6
0
 public static void Show(string tooltip, Rect rect)
 {
     if (s_guiView == null)
     {
         s_guiView = ScriptableObject.CreateInstance<TooltipView>();
         s_guiView.m_tooltipContainer = ScriptableObject.CreateInstance<ContainerWindow>();
         s_guiView.m_tooltipContainer.m_DontSaveToLayout = true;
         s_guiView.m_tooltipContainer.rootView = s_guiView;
         s_guiView.m_tooltipContainer.SetMinMaxSizes(new Vector2(10f, 10f), new Vector2(2000f, 2000f));
     }
     if ((s_guiView.m_tooltip.text != tooltip) || (rect != s_guiView.m_hoverRect))
     {
         s_guiView.Setup(tooltip, rect);
     }
 }
        public static void CloseWindows()
        {
            try
            {
                // Close any existing tooltips
                TooltipView.Close();
            }
            catch (System.Exception) {}

            // Close all container windows
            UnityObject[] containers = Resources.FindObjectsOfTypeAll(typeof(ContainerWindow));
            foreach (ContainerWindow window in containers)
            {
                try
                {
                    window.Close();
                }
                catch (System.Exception) {}
            }

            // Double check correct closing
            UnityObject[] oldWindows = Resources.FindObjectsOfTypeAll(typeof(EditorWindow));
            if (oldWindows.Length != 0)
            {
                string output = "";
                foreach (EditorWindow killme in oldWindows)
                {
                    output += "\n" + killme.GetType().Name;
                    UnityObject.DestroyImmediate(killme, true);
                }

                Debug.LogError("Failed to destroy editor windows: #" + oldWindows.Length + output);
            }

            UnityObject[] oldViews = Resources.FindObjectsOfTypeAll(typeof(View));
            if (oldViews.Length != 0)
            {
                string output = "";
                foreach (View killme in oldViews)
                {
                    output += "\n" + killme.GetType().Name;
                    UnityObject.DestroyImmediate(killme, true);
                }

                Debug.LogError("Failed to destroy views: #" + oldViews.Length + output);
            }
        }
Esempio n. 8
0
        public static void CloseWindows()
        {
            try
            {
                TooltipView.Close();
            }
            catch (Exception ex)
            {
            }
            foreach (ContainerWindow containerWindow in Resources.FindObjectsOfTypeAll(typeof(ContainerWindow)))
            {
                try
                {
                    containerWindow.Close();
                }
                catch (Exception ex)
                {
                }
            }
            UnityEngine.Object[] objectsOfTypeAll1 = Resources.FindObjectsOfTypeAll(typeof(EditorWindow));
            if (objectsOfTypeAll1.Length != 0)
            {
                string str = string.Empty;
                foreach (EditorWindow editorWindow in objectsOfTypeAll1)
                {
                    str = str + "\n" + editorWindow.GetType().Name;
                    UnityEngine.Object.DestroyImmediate((UnityEngine.Object)editorWindow, true);
                }
                UnityEngine.Debug.LogError((object)("Failed to destroy editor windows: #" + (object)objectsOfTypeAll1.Length + str));
            }
            UnityEngine.Object[] objectsOfTypeAll2 = Resources.FindObjectsOfTypeAll(typeof(View));
            if (objectsOfTypeAll2.Length == 0)
            {
                return;
            }
            string str1 = string.Empty;

            foreach (View view in objectsOfTypeAll2)
            {
                str1 = str1 + "\n" + view.GetType().Name;
                UnityEngine.Object.DestroyImmediate((UnityEngine.Object)view, true);
            }
            UnityEngine.Debug.LogError((object)("Failed to destroy views: #" + (object)objectsOfTypeAll2.Length + str1));
        }
Esempio n. 9
0
 public static void CloseWindows()
 {
     try
     {
         TooltipView.Close();
     }
     catch (Exception)
     {
     }
     UnityEngine.Object[] objArray = UnityEngine.Resources.FindObjectsOfTypeAll(typeof(ContainerWindow));
     foreach (ContainerWindow window in objArray)
     {
         try
         {
             window.Close();
         }
         catch (Exception)
         {
         }
     }
     UnityEngine.Object[] objArray3 = UnityEngine.Resources.FindObjectsOfTypeAll(typeof(EditorWindow));
     if (objArray3.Length != 0)
     {
         string str = "";
         foreach (EditorWindow window2 in objArray3)
         {
             str = str + "\n" + window2.GetType().Name;
             UnityEngine.Object.DestroyImmediate(window2, true);
         }
         UnityEngine.Debug.LogError("Failed to destroy editor windows: #" + objArray3.Length + str);
     }
     UnityEngine.Object[] objArray5 = UnityEngine.Resources.FindObjectsOfTypeAll(typeof(View));
     if (objArray5.Length != 0)
     {
         string str2 = "";
         foreach (View view in objArray5)
         {
             str2 = str2 + "\n" + view.GetType().Name;
             UnityEngine.Object.DestroyImmediate(view, true);
         }
         UnityEngine.Debug.LogError("Failed to destroy views: #" + objArray5.Length + str2);
     }
 }
        public static void SaveWindowLayout(string path)
        {
            TooltipView.Close();

            ArrayList all = new ArrayList();

            UnityObject[] windows    = Resources.FindObjectsOfTypeAll(typeof(EditorWindow));
            UnityObject[] containers = Resources.FindObjectsOfTypeAll(typeof(ContainerWindow));
            UnityObject[] views      = Resources.FindObjectsOfTypeAll(typeof(View));

            foreach (ContainerWindow w in containers)
            {
                // skip ContainerWindows that are "dont save me"
                if (w.m_DontSaveToLayout)
                {
                    continue;
                }
                all.Add(w);
            }

            foreach (View w in views)
            {
                // skip Views that belong to "dont save me" container
                if (w.window != null && w.window.m_DontSaveToLayout)
                {
                    continue;
                }
                all.Add(w);
            }

            foreach (EditorWindow w in windows)
            {
                // skip EditorWindows that belong to "dont save me" container
                if (w.m_Parent != null && w.m_Parent.window != null && w.m_Parent.window.m_DontSaveToLayout)
                {
                    continue;
                }
                all.Add(w);
            }

            InternalEditorUtility.SaveToSerializedFileAndForget(all.ToArray(typeof(UnityObject)) as UnityObject[], path, true);
        }
Esempio n. 11
0
        public static void Show(string tooltip, Rect rect)
        {
            if (s_guiView == null)
            {
                s_guiView = ScriptableObject.CreateInstance <TooltipView>();
            }

            if (s_guiView.window == null)
            {
                var newWindow = ScriptableObject.CreateInstance <ContainerWindow>();
                newWindow.m_DontSaveToLayout = true;
                newWindow.rootView           = s_guiView;
                newWindow.SetMinMaxSizes(new Vector2(10.0f, 10.0f), new Vector2(2000.0f, 2000.0f));
                s_guiView.SetWindow(newWindow);
            }

            if (s_guiView.m_tooltip.text == tooltip && rect == s_guiView.m_hoverRect)
            {
                return;
            }

            s_guiView.Setup(tooltip, rect);
        }
Esempio n. 12
0
        public static void SaveWindowLayout(string path)
        {
            TooltipView.Close();
            ArrayList arrayList = new ArrayList();

            UnityEngine.Object[] array  = Resources.FindObjectsOfTypeAll(typeof(EditorWindow));
            UnityEngine.Object[] array2 = Resources.FindObjectsOfTypeAll(typeof(ContainerWindow));
            UnityEngine.Object[] array3 = Resources.FindObjectsOfTypeAll(typeof(View));
            UnityEngine.Object[] array4 = array2;
            for (int i = 0; i < array4.Length; i++)
            {
                ContainerWindow containerWindow = (ContainerWindow)array4[i];
                if (!containerWindow.m_DontSaveToLayout)
                {
                    arrayList.Add(containerWindow);
                }
            }
            UnityEngine.Object[] array5 = array3;
            for (int j = 0; j < array5.Length; j++)
            {
                View view = (View)array5[j];
                if (!(view.window != null) || !view.window.m_DontSaveToLayout)
                {
                    arrayList.Add(view);
                }
            }
            UnityEngine.Object[] array6 = array;
            for (int k = 0; k < array6.Length; k++)
            {
                EditorWindow editorWindow = (EditorWindow)array6[k];
                if (!(editorWindow.m_Parent != null) || !(editorWindow.m_Parent.window != null) || !editorWindow.m_Parent.window.m_DontSaveToLayout)
                {
                    arrayList.Add(editorWindow);
                }
            }
            InternalEditorUtility.SaveToSerializedFileAndForget(arrayList.ToArray(typeof(UnityEngine.Object)) as UnityEngine.Object[], path, false);
        }
Esempio n. 13
0
 protected override void OnDisable()
 {
     base.OnDisable();
     TooltipView.s_guiView = null;
 }
Esempio n. 14
0
 private void ShowMessage(string msg)
 {
     TooltipView.Show(msg, this.GetScreenRect());
 }
Esempio n. 15
0
		private void OnEnable()
		{
			TooltipView.s_guiView = this;
		}
Esempio n. 16
0
 protected override void OnDisable()
 {
     base.OnDisable();
     s_guiView = null;
 }
Esempio n. 17
0
		private void OnDisable()
		{
			TooltipView.s_guiView = null;
		}
Esempio n. 18
0
 private void OnDisable()
 {
     TooltipView.s_guiView = null;
 }
Esempio n. 19
0
 protected override void OnEnable()
 {
     base.OnEnable();
     s_guiView = this;
 }
Esempio n. 20
0
        private static void CloseWindows(bool keepMainWindow)
        {
            try
            {
                // Close any existing tooltips
                TooltipView.Close();
            }
            catch (Exception)
            {
                // ignored
            }

            // Close all container windows
            ContainerWindow mainWindow = null;

            UnityObject[] containers = Resources.FindObjectsOfTypeAll(typeof(ContainerWindow));
            foreach (ContainerWindow window in containers)
            {
                try
                {
                    if (window.showMode != ShowMode.MainWindow || !keepMainWindow || mainWindow != null)
                    {
                        window.Close();
                        UnityObject.DestroyImmediate(window, true);
                    }
                    else
                    {
                        UnityObject.DestroyImmediate(window.rootView, true);
                        window.rootView = null;
                        mainWindow      = window;
                    }
                }
                catch (Exception)
                {
                    // ignored
                }
            }

            // Double check correct closing
            UnityObject[] oldWindows = Resources.FindObjectsOfTypeAll(typeof(EditorWindow));
            if (oldWindows.Length != 0)
            {
                string output = "";
                foreach (EditorWindow killme in oldWindows)
                {
                    output += "\n" + killme.GetType().Name;
                    UnityObject.DestroyImmediate(killme, true);
                }

                Debug.LogError("Failed to destroy editor windows: #" + oldWindows.Length + output);
            }

            UnityObject[] oldViews = Resources.FindObjectsOfTypeAll(typeof(View));
            if (oldViews.Length != 0)
            {
                foreach (View killme in oldViews)
                {
                    UnityObject.DestroyImmediate(killme, true);
                }
            }
        }
Esempio n. 21
0
 private void OnEnable()
 {
     TooltipView.s_guiView = this;
 }
Esempio n. 22
0
 private void OnDisable()
 {
     s_guiView = null;
 }
Esempio n. 23
0
 /// <summary>
 /// Draws a hint at a specific position of the screen.
 /// </summary>
 /// <param name="hint">The content of the hint</param>
 /// <param name="rect">The rect where the hint will be drawn. The top-left corner of the hint will start at the X coordinate</param>
 public static void DrawHintAt(DynamicHintContent hint, Rect rect)
 {
     TooltipView.s_ForceExtensionOfNextDynamicHint = true;
     TooltipView.Show(hint.ToTooltipString(), rect);
 }
Esempio n. 24
0
 private void OnEnable()
 {
     s_guiView = this;
 }
Esempio n. 25
0
 void ShowMessage(string msg)
 {
     TooltipView.Show(msg, GetScreenRect());
 }
Esempio n. 26
0
 protected override void OnEnable()
 {
     base.OnEnable();
     TooltipView.s_guiView = this;
 }
Esempio n. 27
0
 void RemoveMessage()
 {
     TooltipView.Close();
 }
Esempio n. 28
0
 private void OnDisable()
 {
     s_guiView = null;
 }
Esempio n. 29
0
 private void OnEnable()
 {
     s_guiView = this;
 }
Esempio n. 30
0
 /// <summary>
 /// Closes the current DynamicHint being displayed
 /// </summary>
 public static void CloseCurrentHint()
 {
     TooltipView.Close();
 }