void GetUnitAnim(string AnimName, UnitArt UnitArt, string FoundPath, string animType) { Flc Flc = new Flc(); Flc.UnitArt = UnitArt; Flc.Type = string.Format("UNIT_ART_{0}", animType); UnitArt.UnitFlc.Add(Flc); if (System.IO.File.Exists(string.Format(@"Assets\Art\Units\{0}\{1}", this.Name, AnimName)) == false) System.IO.File.Copy(string.Format(@"{0}\{1}", FoundPath, AnimName), string.Format(@"Assets\Art\Units\{0}\{1}", this.Name, AnimName)); Flc.Path = string.Format(@"Assets\Art\Units\{0}\{1}", this.Name, AnimName); Flc.BufferFile(string.Format(@"Assets\Art\Units\{0}\{1}", this.Name, AnimName ) ); }
public void Import(List<string> Paths) { UnitData data = ResourceInterface.AddUnit(); data.NumMoves = this.Movement; data.Cost = this.Cost; data.PopulationCost = this.PopulationCost; data.AIStrategies = this.AIStrategy; data.Attack = this.Attack; data.Defense = this.Defence; data.BombardStr = this.BombardStrength; data.BombardRange = this.BombardRange; data.DomainType = (EUnitData_DomainType)this.UnitClass; bool found = false; string FoundPath = ""; foreach(var Item in Paths) { if (System.IO.Directory.Exists(Item + "\\" + this.Name) == true) { found = true; FoundPath = Item + "\\" + this.Name; break; } } if (found == true) { UnitArt UnitArt = new UnitArt(); ResourceInterface.UnitArtData.Add(UnitArt); UnitArt.Type = "UNIT_ART_" + this.Name.ToUpper().Replace(" ", "_"); data.UnitArt = UnitArt; System.IO.Directory.CreateDirectory(@"Assets\Art\Units\" + this.Name); INIFileHandler.Path = FoundPath + "\\" + this.Name + ".ini"; string AnimName = INIFileHandler.ReadValue("Animations", "DEFAULT"); GetUnitAnim(AnimName, UnitArt, FoundPath, "DEFAULT"); } else { } data.Description = "TXT_KEY_UNIT_" + Name.ToUpper(); }