protected override void CreatePoints() { m_shaderGraph.Array = new float[m_resolution]; m_graphArray = new float[m_resolution]; for (int i = 0; i < m_resolution; i++) { m_shaderGraph.Array[i] = 0; } m_shaderGraph.GoodColor = m_graphyManager.AudioGraphColor; m_shaderGraph.CautionColor = m_graphyManager.AudioGraphColor; m_shaderGraph.CriticalColor = m_graphyManager.AudioGraphColor; m_shaderGraph.UpdateColors(); m_shaderGraph.GoodThreshold = 0; m_shaderGraph.CautionThreshold = 0; m_shaderGraph.UpdateThresholds(); m_shaderGraph.UpdateArray(); m_shaderGraph.Average = 0; m_shaderGraph.UpdateAverage(); }
protected override void CreatePoints() { // Init Arrays m_shaderGraph.Array = new float[m_resolution]; m_shaderGraphHighestValues.Array = new float[m_resolution]; m_graphArray = new float[m_resolution]; m_graphArrayHighestValue = new float[m_resolution]; for (int i = 0; i < m_resolution; i++) { m_shaderGraph.Array[i] = 0; m_shaderGraphHighestValues.Array[i] = 0; } // Color m_shaderGraph.GoodColor = m_graphyManager.AudioGraphColor; m_shaderGraph.CautionColor = m_graphyManager.AudioGraphColor; m_shaderGraph.CriticalColor = m_graphyManager.AudioGraphColor; m_shaderGraph.UpdateColors(); m_shaderGraphHighestValues.GoodColor = m_graphyManager.AudioGraphColor; m_shaderGraphHighestValues.CautionColor = m_graphyManager.AudioGraphColor; m_shaderGraphHighestValues.CriticalColor = m_graphyManager.AudioGraphColor; m_shaderGraphHighestValues.UpdateColors(); // Threshold m_shaderGraph.GoodThreshold = 0; m_shaderGraph.CautionThreshold = 0; m_shaderGraph.UpdateThresholds(); m_shaderGraphHighestValues.GoodThreshold = 0; m_shaderGraphHighestValues.CautionThreshold = 0; m_shaderGraphHighestValues.UpdateThresholds(); // Update Array m_shaderGraph.UpdateArray(); m_shaderGraphHighestValues.UpdateArray(); // Average m_shaderGraph.Average = 0; m_shaderGraph.UpdateAverage(); m_shaderGraphHighestValues.Average = 0; m_shaderGraphHighestValues.UpdateAverage(); }
protected override void UpdateGraph() { int fps = (int)(1 / Time.unscaledDeltaTime); int currentMaxFps = 0; for (int i = 0; i <= m_resolution - 1; i++) { if (i >= m_resolution - 1) { m_fpsArray[i] = fps; } else { m_fpsArray[i] = m_fpsArray[i + 1]; } // Store the highest fps to use as the highest point in the graph if (currentMaxFps < m_fpsArray[i]) { currentMaxFps = m_fpsArray[i]; } } m_highestFps = m_highestFps < 1 || m_highestFps <= currentMaxFps ? currentMaxFps : m_highestFps - 1; for (int i = 0; i <= m_resolution - 1; i++) { m_shaderGraph.Array[i] = m_fpsArray[i] / (float)m_highestFps; } // Update the material values m_shaderGraph.UpdatePoints(); m_shaderGraph.Average = m_fpsMonitor.AverageFPS / m_highestFps; m_shaderGraph.UpdateAverage(); m_shaderGraph.GoodThreshold = (float)m_graphyManager.GoodFPSThreshold / m_highestFps; m_shaderGraph.CautionThreshold = (float)m_graphyManager.CautionFPSThreshold / m_highestFps; m_shaderGraph.UpdateThresholds(); }
protected override void CreatePoints() { m_shaderGraphAllocated.Array = new float[m_resolution]; m_shaderGraphReserved.Array = new float[m_resolution]; m_shaderGraphMono.Array = new float[m_resolution]; m_allocatedArray = new float[m_resolution]; m_reservedArray = new float[m_resolution]; m_monoArray = new float[m_resolution]; for (int i = 0; i < m_resolution; i++) { m_shaderGraphAllocated.Array[i] = 0; m_shaderGraphReserved.Array[i] = 0; m_shaderGraphMono.Array[i] = 0; } // Initialize the material values // Colors m_shaderGraphAllocated.GoodColor = m_graphyManager.AllocatedRamColor; m_shaderGraphAllocated.CautionColor = m_graphyManager.AllocatedRamColor; m_shaderGraphAllocated.CriticalColor = m_graphyManager.AllocatedRamColor; m_shaderGraphAllocated.UpdateColors(); m_shaderGraphReserved.GoodColor = m_graphyManager.ReservedRamColor; m_shaderGraphReserved.CautionColor = m_graphyManager.ReservedRamColor; m_shaderGraphReserved.CriticalColor = m_graphyManager.ReservedRamColor; m_shaderGraphReserved.UpdateColors(); m_shaderGraphMono.GoodColor = m_graphyManager.MonoRamColor; m_shaderGraphMono.CautionColor = m_graphyManager.MonoRamColor; m_shaderGraphMono.CriticalColor = m_graphyManager.MonoRamColor; m_shaderGraphMono.UpdateColors(); // Thresholds m_shaderGraphAllocated.GoodThreshold = 0; m_shaderGraphAllocated.CautionThreshold = 0; m_shaderGraphAllocated.UpdateThresholds(); m_shaderGraphReserved.GoodThreshold = 0; m_shaderGraphReserved.CautionThreshold = 0; m_shaderGraphReserved.UpdateThresholds(); m_shaderGraphMono.GoodThreshold = 0; m_shaderGraphMono.CautionThreshold = 0; m_shaderGraphMono.UpdateThresholds(); m_shaderGraphAllocated.UpdateArray(); m_shaderGraphReserved.UpdateArray(); m_shaderGraphMono.UpdateArray(); // Average m_shaderGraphAllocated.Average = 0; m_shaderGraphReserved.Average = 0; m_shaderGraphMono.Average = 0; m_shaderGraphAllocated.UpdateAverage(); m_shaderGraphReserved.UpdateAverage(); m_shaderGraphMono.UpdateAverage(); }