public Texture2D GetBackground(int num) { if (!Backgrounds.ContainsKey(num)) { string name = String.Format("Images\\Background_{0}", num); Backgrounds[num] = LoadTexture(name); } return(Backgrounds[num]); }
public Texture2D GetBackground(int num) { if (!Backgrounds.ContainsKey(num)) { string name = $"Images\\Background_{num}"; Backgrounds[num] = LoadTexture(name); } return(Backgrounds[num]); }
void LoadBackgrouds(string zipPath, string[] backgrouds) {//Принимает названия картинок и загружает их из игровых архивов foreach (string back in backgrouds) { if (!Backgrounds.ContainsKey(back)) { BitmapImage image = ReadFromZip(zipPath, back).toBitmapImage(); Backgrounds.Add(back, image); } else { continue; } } }