protected virtual void OnEnable() { if (NGPackageExporterWindow.GetVersion != null) { this.version = NGPackageExporterWindow.GetVersion(); } }
private void Export() { string[] paths = AssetDatabase.GetAllAssetPaths(); List <string> exported = new List <string>(512); string packagePath = "Assets/" + ProfilesManager.Profile.packagePath + "/"; for (int i = 0; i < paths.Length; i++) { if (paths[i].StartsWith(packagePath) == true) { int j = 0; for (; j < NGPackageExcluderWindow.DefaultKeywords.Length; j++) { if (paths[i].Contains(NGPackageExcluderWindow.DefaultKeywords[j]) == true) { break; } } if (j < NGPackageExcluderWindow.DefaultKeywords.Length) { continue; } j = 0; for (; j < ProfilesManager.Profile.includeKeywords.Count; j++) { if (paths[i].Contains(ProfilesManager.Profile.includeKeywords[j]) == true) { break; } } if (j < ProfilesManager.Profile.includeKeywords.Count) { continue; } exported.Add(paths[i]); } else if (ProfilesManager.Profile.includeKeywords.Count > 0) { int j = 0; for (; j < ProfilesManager.Profile.includeKeywords.Count; j++) { if (paths[i].Contains(ProfilesManager.Profile.includeKeywords[j]) == true) { break; } } if (j >= ProfilesManager.Profile.includeKeywords.Count) { continue; } exported.Add(paths[i]); } } if (NGPackageExporterWindow.BeforeExport != null) { NGPackageExporterWindow.BeforeExport(this); } AssetDatabase.ExportPackage(exported.ToArray(), Path.Combine(ProfilesManager.Profile.exportPath, this.GetExportName()), ExportPackageOptions.Interactive); }