public override int GetHashCode() { unchecked { return(((assetName != null ? assetName.GetHashCode() : 0) * 397) ^ (bundle != null ? bundle.GetHashCode() : 0)); } }
public override int GetHashCode() { unchecked { var hashCode = (bundle != null ? bundle.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (name != null ? name.GetHashCode() : 0); hashCode = (hashCode * 397) ^ scale.GetHashCode(); return(hashCode); } }
public override int GetHashCode() { unchecked { var hashCode = (bundle != null ? bundle.GetHashCode() : 0); hashCode = (hashCode * 397) ^ devicePixelRatio.GetHashCode(); hashCode = (hashCode * 397) ^ (locale != null ? locale.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (size != null ? size.GetHashCode() : 0); hashCode = (hashCode * 397) ^ platform.GetHashCode(); return(hashCode); } }
private IEnumerator loadItem(string asset) { WWW www = new WWW(asset); yield return(www); AssetBundle bundle = www.assetBundle; Debug.Log(bundle.GetHashCode()); Object[] objs = bundle.LoadAll(); foreach (Object obj in objs) { Debug.Log(obj.GetHashCode()); } //SingleStringHolder holder = bundle.mainAsset as SingleStringHolder; Debug.Log(true); }
private static void XX(JSONObject root, string path, DirectoryInfo di) { DirectoryInfo[] dis = di.GetDirectories(); for (int i = 0; i < dis.Length; i++) { XX(root, path + dis[i].Name, dis[i]); } FileInfo[] fis = di.GetFiles(); for (int i = 0; i < fis.Length; i++) { if (fis[i].Extension == ".normal") { #if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN string abpath = Application.streamingAssetsPath + "/Win64/" + path + "/" + fis[i].Name; #elif UNITY_IOS string abpath = Application.streamingAssetsPath + "/iOS/" + path + "/" + fis[i].Name; #elif UNITY_ANDROID string abpath = Application.streamingAssetsPath + "/Android/" + path + "/" + fis[i].Name; #endif string abname = path + "/" + fis[i].Name; AssetBundle ab = AssetBundle.LoadFromFile(abpath); if (ab != null) { int hash = ab.GetHashCode(); root.AddField(abname, hash); ab.Unload(true); } // } else if (fis[i].Extension == ".manifest") { //#if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN // string abpath = Application.streamingAssetsPath + "/Win64/" + path + "/" + fis[i].Name; //#elif UNITY_IOS // string abpath = Application.streamingAssetsPath + "/iOS/" + path + "/" + fis[i].Name; //#elif UNITY_ANDROID // string abpath = Application.streamingAssetsPath + "/Android/" + path + "/" + fis[i].Name; //#endif // string manifestname = path + "/" + fis[i].Name; // root.AddField(manifestname, 1); } } }
public override int GetHashCode() { unchecked { var hashCode = (AssetBundle != null ? AssetBundle.GetHashCode() : 0); hashCode = (hashCode * 397) ^ AssetBundleInfo.GetHashCode(); hashCode = (hashCode * 397) ^ (loadedAssets != null ? loadedAssets.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (LoadRequest != null ? LoadRequest.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (LoadAssetRequest != null ? LoadAssetRequest.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (SceneRequest != null ? SceneRequest.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (UnloadSceneRequest != null ? UnloadSceneRequest.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (int)_status; #if UNITY_EDITOR hashCode = (hashCode * 397) ^ offset; hashCode = (hashCode * 397) ^ (history != null ? history.GetHashCode() : 0); #endif hashCode = (hashCode * 397) ^ _userReference; hashCode = (hashCode * 397) ^ (References != null ? References.GetHashCode() : 0); return(hashCode); } }
// 创建版本控制文本 static void CreateVersionText() { VersionText verText = new VersionText(); verText.version = "1.0.0"; AssetBundle ab = AssetBundle.LoadFromFile("Assets/AssetBundles/AssetBundles"); AssetBundleManifest am = ab.LoadAsset <AssetBundleManifest> ("AssetBundleManifest"); string[] bdles = am.GetAllAssetBundles(); verText.assetBds = new BundleItemInfo[bdles.Length]; int i = 0; foreach (var item in bdles) { BundleItemInfo bi = new BundleItemInfo(); bi.BDName = item; // 名称 AssetBundle subAB = AssetBundle.LoadFromFile("Assets/AssetBundles/" + item); bi.hashCode = subAB.GetHashCode(); bi.dependences = am.GetAllDependencies(item); verText.assetBds[i] = bi; i++; } string json = JsonMapper.ToJson(verText); string dirPath = Path.Combine(Application.dataPath, "Vertion"); string filePath = Path.Combine(dirPath, "version.txt"); if (!Directory.Exists(dirPath)) { Directory.CreateDirectory(dirPath); } if (File.Exists(filePath)) { File.Delete(filePath); } File.WriteAllText(filePath, json); Debug.Log("----------------->版本控制文本完成"); }