示例#1
0
        public override void DrawUI()
        {
            _spriteBatch.Begin();

            if (sodlierstTextures.Count != _currentWave.AvailableUnits.Count)
            {
                throw new ArgumentException("Something went wrong. Count of rectangles should be the same as Units");
            }
            for (int i = 0; i < sodlierstTextures.Count; i++)
            {
                switch (_currentWave.AvailableUnits[i].UnitType.ToLower())
                {
                case "soldier":
                    _spriteBatch.Draw(soldierTexture2D, sodlierstTextures[i], Color.White);
                    break;

                case "tank":
                    _spriteBatch.Draw(tankTexture2D, sodlierstTextures[i], Color.White);
                    break;

                case "scout":
                    _spriteBatch.Draw(scoutTexture2D, sodlierstTextures[i], Color.White);
                    break;

                default:
                    throw new ArgumentException("Unsupported unit type " + (_currentWave.AvailableUnits[i].UnitType));
                }
            }
            if (_CanStartWave() && !UnitSelected)
            {
                StartWaveBtn.Draw(_spriteBatch);
            }
            _spriteBatch.End();
        }
示例#2
0
 public override void Draw(GameTime gameTime)
 {
     _spriteBatch.Begin();
     btn1.Draw(_spriteBatch);
     btn2.Draw(_spriteBatch);
     btn3.Draw(_spriteBatch);
     _spriteBatch.End();
 }