/// SimpleStat public static void SimpleStat(Rect rect, string text, float value, float baseValue = -1f) { Rect[] hGrid = rect.HorizontalGrid(new float[] { rect.width - 70, 70 }, 5); WindowComponents.Label(hGrid[1], text); WindowComponents.Label(hGrid[2], "<b>" + value.ToString() + "</b>"); }
/// FillableBarWithLabelValue public static void FillableBarWithLabelValue(Rect rect, string name, Vital vital, Color fillColor) { float percent = Utils.Normalize(0, vital.value, vital.currentValue); Rect[] hGrid = rect.HorizontalGrid(new float[] { 70, rect.width - 140, 70 }, 5); WindowComponents.Label(hGrid[1], name); WindowComponents.FillableBar(hGrid[2], percent, vital, fillColor); WindowComponents.Label(hGrid[3], Mathf.Round(percent * 100).ToString() + "%"); }