static void HighlightIndicator(LinearScaleStateIndicatorComponent indicator, float opacity) { OpacityShader shader = new OpacityShader(); shader.Opacity = opacity; indicator.Shader = shader; indicator.States[0].ShapeType = StateIndicatorShapeType.ProgressItem9; }
public void SetProgress(int progress) { progress = progress % linearGauge1.Indicators.Count; LinearScaleStateIndicatorComponent[] highlightedIndicators = new LinearScaleStateIndicatorComponent[highlightedIndicatorsCount]; for (int i = 0; i < highlightedIndicatorsCount; i++) { highlightedIndicators[i] = linearGauge1.Indicators[(progress + i) % linearGauge1.Indicators.Count]; } foreach (LinearScaleStateIndicatorComponent indicator in linearGauge1.Indicators) { indicator.Shader = BaseColorShader.Empty; indicator.States[0].ShapeType = StateIndicatorShapeType.ProgressItem5; } for (int i = 0; i < highlightedIndicatorsCount; i++) { HighlightIndicator(highlightedIndicators[i], opacityValues[i]); } }