Пример #1
0
        private bool DrawEventMesh(FrameDebuggerEventData curEventData)
        {
            Mesh mesh = curEventData.mesh;
            bool result;

            if (mesh == null)
            {
                result = false;
            }
            else
            {
                Rect rect = GUILayoutUtility.GetRect(10f, 10f, new GUILayoutOption[]
                {
                    GUILayout.ExpandHeight(true)
                });
                if (rect.width < 64f || rect.height < 64f)
                {
                    result = true;
                }
                else
                {
                    GameObject frameEventGameObject = FrameDebuggerUtility.GetFrameEventGameObject(curEventData.frameEventIndex);
                    Rect       rect2 = rect;
                    rect2.yMin = rect2.yMax - EditorGUIUtility.singleLineHeight * 2f;
                    Rect position = rect2;
                    rect2.xMin    = rect2.center.x;
                    position.xMax = position.center.x;
                    if (Event.current.type == EventType.MouseDown)
                    {
                        if (rect2.Contains(Event.current.mousePosition))
                        {
                            EditorGUIUtility.PingObject(mesh);
                            Event.current.Use();
                        }
                        if (frameEventGameObject != null && position.Contains(Event.current.mousePosition))
                        {
                            EditorGUIUtility.PingObject(frameEventGameObject.GetInstanceID());
                            Event.current.Use();
                        }
                    }
                    this.m_PreviewDir = PreviewGUI.Drag2D(this.m_PreviewDir, rect);
                    if (Event.current.type == EventType.Repaint)
                    {
                        int meshSubset = curEventData.meshSubset;
                        this.DrawMeshPreview(curEventData, rect, rect2, mesh, meshSubset);
                        if (frameEventGameObject != null)
                        {
                            EditorGUI.DropShadowLabel(position, frameEventGameObject.name);
                        }
                    }
                    result = true;
                }
            }
            return(result);
        }
Пример #2
0
        private bool DrawEventMesh(FrameDebuggerEventData curEventData)
        {
            Mesh mesh = curEventData.mesh;

            if ((UnityEngine.Object)mesh == (UnityEngine.Object)null)
            {
                return(false);
            }
            Rect rect = GUILayoutUtility.GetRect(10f, 10f, new GUILayoutOption[1] {
                GUILayout.ExpandHeight(true)
            });

            if ((double)rect.width < 64.0 || (double)rect.height < 64.0)
            {
                return(true);
            }
            GameObject frameEventGameObject = FrameDebuggerUtility.GetFrameEventGameObject(curEventData.frameEventIndex);
            Rect       meshInfoRect         = rect;

            meshInfoRect.yMin = meshInfoRect.yMax - EditorGUIUtility.singleLineHeight * 2f;
            Rect position = meshInfoRect;

            meshInfoRect.xMin = meshInfoRect.center.x;
            position.xMax     = position.center.x;
            if (Event.current.type == EventType.MouseDown)
            {
                if (meshInfoRect.Contains(Event.current.mousePosition))
                {
                    EditorGUIUtility.PingObject((UnityEngine.Object)mesh);
                    Event.current.Use();
                }
                if ((UnityEngine.Object)frameEventGameObject != (UnityEngine.Object)null && position.Contains(Event.current.mousePosition))
                {
                    EditorGUIUtility.PingObject(frameEventGameObject.GetInstanceID());
                    Event.current.Use();
                }
            }
            this.m_PreviewDir = PreviewGUI.Drag2D(this.m_PreviewDir, rect);
            if (Event.current.type == EventType.Repaint)
            {
                int meshSubset = curEventData.meshSubset;
                this.DrawMeshPreview(curEventData, rect, meshInfoRect, mesh, meshSubset);
                if ((UnityEngine.Object)frameEventGameObject != (UnityEngine.Object)null)
                {
                    EditorGUI.DropShadowLabel(position, frameEventGameObject.name);
                }
            }
            return(true);
        }
Пример #3
0
 internal void ChangeFrameEventLimit(int newLimit)
 {
     if (newLimit > 0 && newLimit <= FrameDebuggerUtility.count)
     {
         if (newLimit != FrameDebuggerUtility.limit && newLimit > 0)
         {
             GameObject frameEventGameObject = FrameDebuggerUtility.GetFrameEventGameObject(newLimit - 1);
             if (frameEventGameObject != null)
             {
                 EditorGUIUtility.PingObject(frameEventGameObject);
             }
         }
         FrameDebuggerUtility.limit = newLimit;
         if (this.m_Tree != null)
         {
             this.m_Tree.SelectFrameEventIndex(newLimit);
         }
     }
 }
Пример #4
0
 internal void ChangeFrameEventLimit(int newLimit)
 {
     if (newLimit <= 0 || newLimit > FrameDebuggerUtility.count)
     {
         return;
     }
     if (newLimit != FrameDebuggerUtility.limit && newLimit > 0)
     {
         GameObject frameEventGameObject = FrameDebuggerUtility.GetFrameEventGameObject(newLimit - 1);
         if ((UnityEngine.Object)frameEventGameObject != (UnityEngine.Object)null)
         {
             EditorGUIUtility.PingObject((UnityEngine.Object)frameEventGameObject);
         }
     }
     FrameDebuggerUtility.limit = newLimit;
     if (this.m_Tree == null)
     {
         return;
     }
     this.m_Tree.SelectFrameEventIndex(newLimit);
 }