Exemplo n.º 1
0
    /// <summary>
    /// Makes the profiler track a new profiler label
    /// </summary>
    /// <param name="label">The name of the profiler label to track</param>
    /// <param name="c">The color that this particular label should show up as on the visualizers</param>
    /// <param name="visible">If the label should be drawn from the start</param>
    /// <returns>false if the label is already tracked</returns>
    public bool CreateRecorder(string label, RecorderLayout layout)
    {
        int index = GetFreeSpot();

        profilerData.recorderData[index].layout = layout;
        AttachRecorder(label, index);

        for (int j = 0; j < visualizers.Count; j++)
        {
            visualizers[j].OnRecorderAttached(profilerData.recorderData[index]);
        }
        return(true);
    }
Exemplo n.º 2
0
    /// <summary>
    /// Creates a custom recorder which displays the runtime between its Begin() and End() calls.
    /// Useful for tracking performance of enemy AI or other resource intensive tasks
    /// </summary>
    /// <param name="label">Name to appear on visualisers</param>
    /// <param name="layout">The layout on visualisers</param>
    /// <returns></returns>
    public CustomSampler CreateCustomRecorder(string label, RecorderLayout layout)
    {
        int index = GetFreeSpot();

        profilerData.recorderData[index].layout = layout;
        CustomSampler ret = AttachCustomRecorder(label, index);

        for (int j = 0; j < visualizers.Count; j++)
        {
            visualizers[j].OnRecorderAttached(profilerData.recorderData[index]);
        }
        return(ret);
    }