private void AddAllSkyBoxes() { skyBoxes.Clear(); string tempSkyBoxFolder = TheResourceManager.SkyBoxDirectory; string[] files = Directory.GetFiles(tempSkyBoxFolder, "SkyBox_T*.*"); List <string> fileList = new List <string>(); foreach (string aFile in files) { string extension = Path.GetExtension(aFile); if (extension != null) { string tempExt = extension.ToLower(); if (tempExt == ".jpg" || tempExt == ".png") { string tempRelPath = Path.Combine(skypBoxFolder, Path.GetFileName(aFile)); fileList.Add(tempRelPath); } } } foreach (string tempSkyBoxPath in fileList) { ObjGroupSkyBox tempSkyBoxGroup = ObjGroupSkyBox.GetNewSkyBoxTypeT(program, tempSkyBoxPath); tempSkyBoxGroup.Name = Path.GetFileNameWithoutExtension(tempSkyBoxPath); skyBoxes.Add(tempSkyBoxGroup); } }