/// <summary> /// Allows you to switch between sharing the y-axis on a graph for all subgraphs, or for them to be independent. /// </summary> /// <param name="graph"></param> /// <param name="shared_y_axis"></param> public static void ShareYAxis(string graph, bool shared_y_axis) { #if UNITY_EDITOR if (!Instance.Graphs.ContainsKey(graph)) { Instance.Graphs[graph] = new GraphItDataLuaPro(graph); } GraphItDataLuaPro g = Instance.Graphs[graph]; g.mSharedYAxis = shared_y_axis; #endif }
/// <summary> /// Optional setup function that allows you to specify if the graph is hidden or not by default /// </summary> /// <param name="graph"></param> /// <param name="subgraph"></param> /// <param name="include_0"></param> public static void GraphSetupHidden(string graph, bool hidden) { #if UNITY_EDITOR if (!Instance.Graphs.ContainsKey(graph)) { Instance.Graphs[graph] = new GraphItDataLuaPro(graph); } GraphItDataLuaPro g = Instance.Graphs[graph]; g.SetHidden(hidden); #endif }
/// <summary> /// Optional setup function that allows you to specify the initial height of a graph. /// </summary> /// <param name="graph"></param> /// <param name="subgraph"></param> /// <param name="height"></param> public static void GraphSetupHeight(string graph, float height) { #if UNITY_EDITOR if (!Instance.Graphs.ContainsKey(graph)) { Instance.Graphs[graph] = new GraphItDataLuaPro(graph); } GraphItDataLuaPro g = Instance.Graphs[graph]; g.SetHeight(height); #endif }
/// <summary> /// Optional setup function that allows you to specify both the inclusion of Y-axis 0. /// </summary> /// <param name="graph"></param> /// <param name="subgraph"></param> /// <param name="include_0"></param> public static void GraphSetupInclude0(string graph, bool include_0) { #if UNITY_EDITOR if (!Instance.Graphs.ContainsKey(graph)) { Instance.Graphs[graph] = new GraphItDataLuaPro(graph); } GraphItDataLuaPro g = Instance.Graphs[graph]; g.mInclude0 = include_0; #endif }
/// <summary> /// Optional setup function that allows you to specify the color of the subgraph. /// </summary> /// <param name="graph"></param> /// <param name="subgraph"></param> /// <param name="color"></param> public static void GraphSetupColour(string graph, string subgraph, Color color) { #if UNITY_EDITOR if (!Instance.Graphs.ContainsKey(graph)) { Instance.Graphs[graph] = new GraphItDataLuaPro(graph); } GraphItDataLuaPro g = Instance.Graphs[graph]; if (!g.mData.ContainsKey(subgraph)) { g.mData[subgraph] = new GraphItDataInternalLuaPro(g.mData.Count); } g.mData[subgraph].mColor = color; #endif }
public static void Clear() { if (!mInstance) { return; } foreach (KeyValuePair <string, GraphItDataLuaPro> kv in mInstance.Graphs) { GraphItDataLuaPro g = kv.Value; g.mCurrentIndex = 0; foreach (KeyValuePair <string, GraphItDataInternalLuaPro> entry in g.mData) { GraphItDataInternalLuaPro gdi = entry.Value; gdi.mDataInfos.Clear(); } } }
/// <summary> /// Optional setup function that allows you to specify how many samples to track. /// </summary> /// <param name="graph"></param> /// <param name="sample_window"></param> public static void GraphSetupSampleWindowSize(string graph, int sample_window) { #if UNITY_EDITOR if (!Instance.Graphs.ContainsKey(graph)) { Instance.Graphs[graph] = new GraphItDataLuaPro(graph); } GraphItDataLuaPro g = Instance.Graphs[graph]; int samples = Math.Max(sample_window, GraphItDataLuaPro.RECENT_WINDOW_SIZE + 1); g.mWindowSize = samples; //foreach (KeyValuePair<string, GraphItDataInternalLuaPro> entry in g.mData) //{ // //GraphItDataInternalLuaPro _g = entry.Value; // //_g.mDataPoints = new float[samples]; //} #endif }
/// <summary> /// Log floating point data for this frame. Mutiple calls to this with the same graph will add logged values together. /// </summary> /// <param name="graph"></param> /// <param name="subgraph"></param> /// <param name="f"></param> public static void Log(string graph, string subgraph, List <DataInfo> diList) { #if UNITY_EDITOR if (!Instance.Graphs.ContainsKey(graph)) { Instance.Graphs[graph] = new GraphItDataLuaPro(graph); } GraphItDataLuaPro g = Instance.Graphs[graph]; if (!g.mData.ContainsKey(subgraph)) { g.mData[subgraph] = new GraphItDataInternalLuaPro(g.mData.Count); } foreach (var di in diList) { g.mData[subgraph].mDataInfos.Add(di); } Instance.Graphs[graph].mCurrentIndex += diList.Count; #endif }