public void ImportFolder(string folder, AssetType assetType, SearchOption searchOption) { if (string.IsNullOrWhiteSpace(folder) || !Directory.Exists(folder)) { return; } foreach (string filePath in Directory.GetFiles(folder, $"*{assetType.GetFileExtension()}", searchOption)) { string assetName = Path.GetFileNameWithoutExtension(filePath); bool isFragmentShader = false; if (assetType == AssetType.Shader) { isFragmentShader = assetName.EndsWith("_fragment", StringComparison.InvariantCulture); assetName = assetName.TrimEnd("_fragment").TrimEnd("_vertex"); } AssetRowControl?rowControl = RowControls.Find(a => a.Asset.AssetName == assetName); if (rowControl == null) { continue; } if (isFragmentShader && rowControl.Asset is ShaderAsset shaderAsset) { shaderAsset.EditorPathFragmentShader = filePath; } else { rowControl.Asset.EditorPath = filePath; } rowControl.UpdateGui(); } }