public static void Window(GUIContent title, SceneViewOverlay.WindowFunction sceneViewFunc, int order, UnityEngine.Object target, SceneViewOverlay.WindowDisplayOption option)
 {
     if (Event.current.type != EventType.Layout)
     {
         return;
     }
     using (List <SceneViewOverlay.OverlayWindow> .Enumerator enumerator = SceneViewOverlay.m_Windows.GetEnumerator())
     {
         while (enumerator.MoveNext())
         {
             SceneViewOverlay.OverlayWindow current = enumerator.Current;
             if (option == SceneViewOverlay.WindowDisplayOption.OneWindowPerTarget && current.m_Target == target && target != (UnityEngine.Object)null || option == SceneViewOverlay.WindowDisplayOption.OneWindowPerTitle && (current.m_Title == title || current.m_Title.text == title.text))
             {
                 return;
             }
         }
     }
     SceneViewOverlay.m_Windows.Add(new SceneViewOverlay.OverlayWindow()
     {
         m_Title          = title,
         m_SceneViewFunc  = sceneViewFunc,
         m_PrimaryOrder   = order,
         m_SecondaryOrder = SceneViewOverlay.m_Windows.Count,
         m_Target         = target
     });
 }
        private void WindowTrampoline(int id)
        {
            GUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            GUILayout.BeginVertical();
            GUILayout.FlexibleSpace();
            GUILayout.BeginVertical();
            float num = -this.k_WindowPadding;

            using (List <SceneViewOverlay.OverlayWindow> .Enumerator enumerator = SceneViewOverlay.m_Windows.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    SceneViewOverlay.OverlayWindow current = enumerator.Current;
                    GUILayout.Space(this.k_WindowPadding + num);
                    num = 0.0f;
                    EditorGUIUtility.ResetGUIState();
                    GUI.skin = EditorGUIUtility.GetBuiltinSkin(EditorSkin.Scene);
                    EditorStyles.UpdateSkinCache(1);
                    GUILayout.BeginVertical(current.m_Title, GUI.skin.window, new GUILayoutOption[0]);
                    current.m_SceneViewFunc(current.m_Target, this.m_SceneView);
                    GUILayout.EndVertical();
                }
            }
            EditorStyles.UpdateSkinCache();
            GUILayout.EndVertical();
            this.EatMouseInput(GUILayoutUtility.GetLastRect());
            GUILayout.EndVertical();
            GUILayout.EndHorizontal();
        }
Beispiel #3
0
 public static void Window(GUIContent title, SceneViewOverlay.WindowFunction sceneViewFunc, int order, UnityEngine.Object target, SceneViewOverlay.WindowDisplayOption option)
 {
     if (Event.current.type != EventType.Layout)
     {
         return;
     }
     foreach (SceneViewOverlay.OverlayWindow current in SceneViewOverlay.m_Windows)
     {
         if (option == SceneViewOverlay.WindowDisplayOption.OneWindowPerTarget && current.m_Target == target && target != null)
         {
             return;
         }
         if (option == SceneViewOverlay.WindowDisplayOption.OneWindowPerTitle && (current.m_Title == title || current.m_Title.text == title.text))
         {
             return;
         }
     }
     SceneViewOverlay.OverlayWindow overlayWindow = new SceneViewOverlay.OverlayWindow();
     overlayWindow.m_Title          = title;
     overlayWindow.m_SceneViewFunc  = sceneViewFunc;
     overlayWindow.m_PrimaryOrder   = order;
     overlayWindow.m_SecondaryOrder = SceneViewOverlay.m_Windows.Count;
     overlayWindow.m_Target         = target;
     SceneViewOverlay.m_Windows.Add(overlayWindow);
 }