public MonitoringClientFactory(DateTime dtStart, DateTime dtEnd, double?maxValue, bool isConcentratorsEnabled, bool isMetersEnabled, List <int> selectedEvents, List <byte> selectedСhannels, VALUES_FLAG_DB?filterFlag, CancellationToken cancellationToken, ProgressBarButton progressBar, Action <TStatisticInformation> showTotalStatistic, Guid waiterId, MonitoringDBSupport monitoringDBResult, ModuleType типМодуля) { DtStart = dtStart; DtEnd = dtEnd; _maxValue = maxValue; IsConcentratorsEnabled = isConcentratorsEnabled; IsMetersEnabled = isMetersEnabled; _selectedEvents = selectedEvents; _selectedСhannels = selectedСhannels; _filterFlag = filterFlag; _cancellationToken = cancellationToken; _rowsComparer = new TMonitoringAnalyseRowEqualityComparer(); MonitoringAnalyseDict = MakeMonitoringSource(monitoringDBResult, типМодуля); _progressBar = progressBar; _showTotalStatistic = showTotalStatistic; _waiterId = waiterId; _progressBar.SetIndeterminat(true); }
private void Update() { RaycastHit hit; Debug.DrawRay(transform.position, transform.forward * rayLength, Color.green); // Checks if any object is being looked at and handle the result if (Physics.Raycast(transform.position, transform.forward, out hit, rayLength)) { if (hit.transform.gameObject != null) { HitObject(hit.transform.gameObject); } else { HitObject(null); } } else { HitObject(null); } // Updates progressbars if any were looked at this and/or last frame if (previousObject != null) { var currentProgressbarButton = previousObject.GetComponent <ProgressBarButton>(); if (currentProgressbarButton != null) { timer += Time.deltaTime; currentProgressbarButton.SetProgress(Mathf.Clamp(timer / gazeDuration, 0.0f, 1.0f)); if (currentProgressbarButton.isProgressBarFilled) { currentProgressbarButton.Proceed(); previousObject = null; timer = 0; } if (previousProgressbarButton != null && currentProgressbarButton != previousProgressbarButton) { previousProgressbarButton.ResetProgress(); } previousProgressbarButton = currentProgressbarButton; } else if (previousProgressbarButton != null) { previousProgressbarButton.ResetProgress(); previousProgressbarButton = null; } } else if (previousProgressbarButton != null) { previousProgressbarButton.ResetProgress(); previousProgressbarButton = null; } }
public void SetProgressButtonValue(string text, float value) { foreach (UI_Component component in UI_Components) { if (component.GetType() == typeof(ProgressBarButton)) { // Set the Progress Bar's value ProgressBarButton pbb = (ProgressBarButton)component; if (pbb.Text == text) { pbb.Value = value; } } } }
public CombatStateTargetUI(ContentManager _content) { Texture2D buttonTexture = _content.Load <Texture2D>(ControlConstants.BUTTON_TEXTURE); SpriteFont buttonFont = _content.Load <SpriteFont>(ControlConstants.BUTTON_FONT); Texture2D pixelTexture = _content.Load <Texture2D>(Config.PIXEL_TEXTURE); BorderBox CanvasBox = new BorderBox(pixelTexture) { BorderBoxInfo = ControlConstants.COMBATMODE_CANVAS }; Button BuildModeButton = new Button(buttonTexture, buttonFont) { ButtonInfo = ControlConstants.COMBATMODE_BUILDMODE, }; ProgressBarButton TargetEnemyShipButton = new ProgressBarButton(buttonTexture, buttonFont) { ButtonInfo = ControlConstants.COMBATMODE_TARGETENEMYSHIP, }; ProgressBarButton TargetStoragesButton = new ProgressBarButton(buttonTexture, buttonFont) { ButtonInfo = ControlConstants.COMBATMODE_TARGETSTORAGES, }; ProgressBarButton TargetWeaponsButton = new ProgressBarButton(buttonTexture, buttonFont) { ButtonInfo = ControlConstants.COMBATMODE_TARGETWEAPONS, }; ProgressBarButton TargetPowerGenButton = new ProgressBarButton(buttonTexture, buttonFont) { ButtonInfo = ControlConstants.COMBATMODE_TARGETPOWERGEN, }; ProgressBarButton TargetPowerStorageButton = new ProgressBarButton(buttonTexture, buttonFont) { ButtonInfo = ControlConstants.COMBATMODE_TARGETPOWERSTORAGE, }; TextBox CombatModeTitle = new TextBox(buttonFont) { TextBoxInfo = ControlConstants.COMBATMODE_TITLE, }; _gridBox = new BorderBox(pixelTexture) { BorderBoxInfo = ControlConstants.BUILDMODE_GRIDBOX }; Button FireWeapon = new Button(buttonTexture, buttonFont) { ButtonInfo = ControlConstants.COMBATMODE_FIREWEAPON }; Button RepairRoom = new Button(buttonTexture, buttonFont) { ButtonInfo = ControlConstants.COMBATMODE_REPAIRROOM }; UI_Components = new List <UI_Component>() { CanvasBox, BuildModeButton, CombatModeTitle, _gridBox, TargetEnemyShipButton, TargetStoragesButton, TargetWeaponsButton, TargetPowerGenButton, TargetPowerStorageButton, FireWeapon, RepairRoom }; }