static Rect IndicatorRectForFlowEventType(ProfilerFlowEventType flowEventType, Rect sampleRect, out float indicatorAngularRotationDegrees) { indicatorAngularRotationDegrees = 0f; var flowIndicatorPosition = Vector2.zero; var texturePadding = Styles.textureSize * Styles.texturePadding01; switch (flowEventType) { case ProfilerFlowEventType.Begin: { // Begin arrows anchor to the bottom left corner of the sample rect. flowIndicatorPosition = new Vector2(sampleRect.position.x - texturePadding.x, sampleRect.max.y - texturePadding.y); break; } case ProfilerFlowEventType.Next: case ProfilerFlowEventType.ParallelNext: { // Next arrows anchor to the bottom left corner of the sample rect. The arrow texture will be rotated by -90deg, so adjust padding accordingly. var halfTextureSize = Styles.textureSize * 0.5f; var adjustedPadding = new Vector2(texturePadding.y, texturePadding.x); flowIndicatorPosition = new Vector2(sampleRect.position.x - adjustedPadding.x, sampleRect.max.y - halfTextureSize.y); indicatorAngularRotationDegrees = -90f; break; } case ProfilerFlowEventType.End: { // End arrows anchor to the lower right corner of the sample rect. The arrow texture will be rotated by 180deg. var halfTextureSize = Styles.textureSize * 0.5f; flowIndicatorPosition = new Vector2(sampleRect.max.x - halfTextureSize.x, sampleRect.max.y - Styles.textureSize.y + texturePadding.y); indicatorAngularRotationDegrees = 180f; break; } default: break; } return(new Rect(flowIndicatorPosition, Styles.textureSize)); }
public static extern void FlowEvent(uint flowId, ProfilerFlowEventType flowEventType);