private void CreateShieldBar(IUnit unit) { var progressBar = new CustomProgressBar { Size = new Size(ProgrssBarSizeX, ProgressBarSizeY), Maximum = unit.MaxHP, Value = unit.DefensePoints, Tag = new CustomProgBarTag(unit, this.Controller) }; progressBars.Add(progressBar); this.SetShieldBarLocation(unit, progressBar); this.gameWindow.Controls.Add(progressBar); // progressBar.BringToFront(); }
//--------- private void CreateProgressBar(IUnit unit) { var progressBar = new CustomProgressBar { Size = new Size(ProgrssBarSizeX, ProgressBarSizeY), Maximum = unit.MaxHP, Value = unit.CurrentHP, Tag = new CustomProgBarTag(unit, this.Controller) }; progressBars.Add(progressBar); this.SetProgressBarLocation(unit, progressBar); //test if (unit is EnemyNPCUnit) { progressBar.SetState(2); } // //endTest this.gameWindow.Controls.Add(progressBar); // progressBar.BringToFront(); }