Пример #1
0
 public static GraphicDefinition LoadGraphicDefinition(UnitEntityType unit)
 {
     GraphicDefinition def = new GraphicDefinition();
     switch (unit)
     {
         case UnitEntityType.Cube:
             def.Model = contentManager.Load<Model>("cubealpha");
             break;
         //case UnitEntityType.Worker:
         //    def.OverviewTexture2DWalk = contentManager.Load<Texture2D>("AntWalk");
         //    def.OverviewTexture2DBite = contentManager.Load<Texture2D>("AntBite");
         //    def.OverviewTexture2DDeath = contentManager.Load<Texture2D>("AntDeath");
         //    def.SpriteSize = new Basic.Size(256, 256);
         //    def.WalkSprites = 6;
         //    break;
         //case UnitEntityType.Soldier:
         //    def.OverviewTexture2DWalk = contentManager.Load<Texture2D>("AntWalk");
         //    def.OverviewTexture2DBite = contentManager.Load<Texture2D>("AntBite");
         //    def.OverviewTexture2DDeath = contentManager.Load<Texture2D>("AntDeath");
         //    def.SpriteSize = new Basic.Size(256, 256);
         //    def.WalkSprites = 6;
         //    break;
         //case UnitEntityType.Breeder:
         //    def.OverviewTexture2DWalk = contentManager.Load<Texture2D>("AntWalk");
         //    def.OverviewTexture2DBite = contentManager.Load<Texture2D>("AntBite");
         //    def.OverviewTexture2DDeath = contentManager.Load<Texture2D>("AntDeath");
         //    def.SpriteSize = new Basic.Size(256, 256);
         //    def.WalkSprites = 6;
         //    break;
         default: throw new ArgumentException("Unknown/Unhandled UnitEntityType");
     }
     return def;
 }
Пример #2
0
        public override void LoadContent()
        {
            this.graphicDefinition = UnitContentManager.LoadGraphicDefinition(this.unittype.UnitEntityType);
            //this.destinationRectangle.Width = this.graphicDefinition.SpriteSize.Width;
            //this.destinationRectangle.Height = this.graphicDefinition.SpriteSize.Height;

            this.unittype = null;
            base.LoadContent();
        }
Пример #3
0
        public override void LoadContent()
        {
            this.graphicDefinition = UnitContentManager.LoadGraphicDefinition(this.unittype.UnitEntityType);
            //this.destinationRectangle.Width = this.graphicDefinition.SpriteSize.Width;
            //this.destinationRectangle.Height = this.graphicDefinition.SpriteSize.Height;

            this.unittype = null;
            base.LoadContent();
        }