| | 1 | | using UnityEngine; |
| | 2 | |
|
| | 3 | | namespace DCL.FPSDisplay |
| | 4 | | { |
| | 5 | | public class FPSColoring |
| | 6 | | { |
| 0 | 7 | | public static FPSColor[] coloring = |
| | 8 | | { |
| | 9 | | new FPSColor(Color.green, FPSEvaluation.GREAT), |
| | 10 | | new FPSColor(Color.white, FPSEvaluation.GOOD), |
| | 11 | | new FPSColor(Color.yellow, FPSEvaluation.BAD), |
| | 12 | | new FPSColor(new Color(0.9764706f, 0.4117647f, 0.05490196f), FPSEvaluation.WORSE), |
| | 13 | | new FPSColor(Color.red, FPSEvaluation.UNBEARABLE), |
| | 14 | | }; |
| | 15 | |
|
| | 16 | | public static Color GetDisplayColor(float fps) |
| | 17 | | { |
| 0 | 18 | | for (int i = 0; i < coloring.Length; i++) |
| | 19 | | { |
| 0 | 20 | | if (fps >= coloring[i].fps) |
| | 21 | | { |
| 0 | 22 | | return coloring[i].color; |
| | 23 | | } |
| | 24 | | } |
| | 25 | |
|
| 0 | 26 | | return coloring[coloring.Length - 1].color; |
| | 27 | | } |
| | 28 | | } |
| | 29 | | } |