public override int GetHashCode() { unchecked { var hashCode = (int)type; hashCode = (hashCode * 397) ^ (message != null ? message.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (obj != null ? obj.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (objFullPath != null ? objFullPath.GetHashCode() : 0); hashCode = (hashCode * 397) ^ location.GetHashCode(); return(hashCode); } }
public override int GetHashCode() { int hash = 1; if (matchPatternCase_ == MatchPatternOneofCase.OneOf) { hash ^= OneOf.GetHashCode(); } hash ^= (int)matchPatternCase_; if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
/// <summary> /// 从当前Bundle组集合中删除一组Bundle的配置 /// </summary> public static void Delete() { if ((EGameBundle)focusGame != EGameBundle.EGB_ALL) { foreach (var OneOf in Setting.ListOfBundles) { if (OneOf.GetHashCode() == SelBundle) { Setting.ListOfBundles.Remove(OneOf); break; } } } else { EditorUtility.DisplayDialog("Warning", "Can not delete a bundle in preview model(ALL)", "Cancel"); } }
/// <summary> /// 生成BundleManager的Bundle配置 /// </summary> private static void UpdateBundleManager() { clearallflag(); CollectNeedBuildBundles(); AssetDatabase.Refresh(); RebuiltRelation.Clear(); float PreProgress = cookingSetting.ListOfBundles.Count > 0 ? 1.0f / cookingSetting.ListOfBundles.Count : 1.0f; float CurProgress = 0; List <BundleInfo.Element> AllToBuild = new List <BundleInfo.Element>(); bool BuildSelection = false; foreach (var OneOf in cookingSetting.ListOfBundles) { if (OneOf.GetHashCode() == SelBundle) { AllToBuild.Add(OneOf); BuildSelection = true; break; } } if (!BuildSelection) { AllToBuild = cookingSetting.ListOfBundles; } foreach (var OneOf in AllToBuild) { if (OneOf.Mode == BundleInfo.BundleMode.AllInOne) { List <string> Files = FileSystem.GetSubFiles(OneOf.Path); for (int Index = 0; Index < Files.Count; ++Index) { Files[Index] = OneOf.Path + "/" + Files[Index]; } CurProgress += PreProgress; if (Files.Count <= 0) { continue; } EditorUtility.DisplayProgressBar("生成BundleManager配置", "处理配置 : " + OneOf.Name + " of " + OneOf.gameName, CurProgress); string fullname = OneOf.Path + "/" + OneOf.Name; SetSingleAssetBundleName(OneOf.Path, OneOf.Name, "u"); UnityEngine.Debug.Log(fullname + "..........." + fullname.Replace('/', '_')); } else if (OneOf.Mode == BundleInfo.BundleMode.SeparateSubFile) { List <string> Files = FileSystem.GetSubFiles(OneOf.Path); float Step = Files.Count > 0 ? PreProgress / (1.0f * Files.Count) : 1.0f; foreach (var OneOfFile in Files) { CurProgress += Step; string tmpfile = OneOfFile.Replace("/", "_"); string BundleName = OneOf.Name + "_" + tmpfile; EditorUtility.DisplayProgressBar("生成BundleManager配置", "处理配置 : " + BundleName + " of " + OneOf.gameName, CurProgress); string fullname = OneOf.Path + "/" + OneOfFile; SetSingleAssetBundleName(fullname, fullname.Replace('/', '_'), "u"); UnityEngine.Debug.Log(fullname + "............" + fullname.Replace('/', '_')); } } else if (OneOf.Mode == BundleInfo.BundleMode.SeparateSubFolder) { List <string> Folders = FileSystem.GetSubFolders(OneOf.Path); float Step = Folders.Count > 0 ? PreProgress / (1.0f * Folders.Count) : 1.0f; foreach (var OneOfFolder in Folders) { List <string> Files = FileSystem.GetSubFiles(OneOf.Path + "/" + OneOfFolder); for (int Index = 0; Index < Files.Count; ++Index) { Files[Index] = OneOf.Path + "/" + OneOfFolder + "/" + Files[Index]; } CurProgress += Step; if (Files.Count <= 0) { continue; } string BundleName = OneOf.Name + "_" + OneOfFolder; EditorUtility.DisplayProgressBar("生成BundleManager配置", "处理配置 : " + BundleName + " of " + OneOf.gameName, CurProgress); string fullname = OneOf.Path + "/" + OneOfFolder; SetSingleAssetBundleName(fullname, fullname.Replace('/', '_'), "u"); UnityEngine.Debug.Log(fullname + "......." + fullname.Replace('/', '_')); } if (!Directory.Exists(OneOf.Path)) { continue; } } else if (OneOf.Mode == BundleInfo.BundleMode.SingleFile) { List <string> Files = new List <string>(); Files.Add(OneOf.Path); CurProgress += PreProgress; if (Files.Count <= 0) { continue; } EditorUtility.DisplayProgressBar("生成BundleManager配置", "处理配置 : " + OneOf.Name + " of " + OneOf.gameName, CurProgress); string fullname = OneOf.Path + "......." + OneOf.Name; SetSingleAssetBundleName(fullname, fullname.Replace('/', '_'), "u"); UnityEngine.Debug.Log(fullname + "......." + fullname.Replace('/', '_')); } else if (OneOf.Mode == BundleInfo.BundleMode.SceneBundle) { List <string> Files = new List <string>(); Files.Add(OneOf.Path); CurProgress += PreProgress; if (Files.Count <= 0) { continue; } EditorUtility.DisplayProgressBar("生成BundleManager配置", "处理配置 : " + OneOf.Name + " of " + OneOf.gameName, CurProgress); // string fullname = OneOf.Path; SetSingleAssetBundleName(OneOf.Path, OneOf.Name, "u"); } } EditorUtility.ClearProgressBar(); }