private bool DrawEventMesh(int curEventIndex, FrameDebuggerEvent curEvent) { int frameEventMeshID = FrameDebuggerUtility.GetFrameEventMeshID(curEventIndex); if (frameEventMeshID == 0) { return(false); } UnityEngine.Object @object = EditorUtility.InstanceIDToObject(frameEventMeshID); Mesh mesh = @object as Mesh; if (mesh == null) { return(false); } Rect rect = GUILayoutUtility.GetRect(10f, 10f, new GUILayoutOption[] { GUILayout.ExpandHeight(true) }); if (rect.width < 64f || rect.height < 64f) { return(true); } GameObject gameObjectForEvent = FrameDebuggerWindow.GetGameObjectForEvent(curEventIndex); 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(frameEventMeshID); Event.current.Use(); } if (gameObjectForEvent != null && position.Contains(Event.current.mousePosition)) { EditorGUIUtility.PingObject(gameObjectForEvent.GetInstanceID()); Event.current.Use(); } } this.m_PreviewDir = PreviewGUI.Drag2D(this.m_PreviewDir, rect); if (Event.current.type == EventType.Repaint) { int frameEventMeshSubset = FrameDebuggerUtility.GetFrameEventMeshSubset(curEventIndex); this.DrawMeshPreview(curEvent, rect, rect2, mesh, frameEventMeshSubset); if (gameObjectForEvent != null) { EditorGUI.DropShadowLabel(position, gameObjectForEvent.name); } } return(true); }
internal void ChangeFrameEventLimit(int newLimit) { if (newLimit <= 0 || newLimit > FrameDebuggerUtility.count) { return; } if (newLimit != FrameDebuggerUtility.limit && newLimit > 0) { GameObject gameObjectForEvent = FrameDebuggerWindow.GetGameObjectForEvent(newLimit - 1); if (gameObjectForEvent != null) { EditorGUIUtility.PingObject(gameObjectForEvent); } } FrameDebuggerUtility.limit = newLimit; if (this.m_Tree != null) { this.m_Tree.SelectFrameEventIndex(newLimit); } }