private void OnGUI_AssetViewer(int nID) { this.v2ScrollPostion = GUILayout.BeginScrollView(this.v2ScrollPostion, new GUILayoutOption[0]); if (this.lstBundleFileInfo != null) { this.styleButton = new GUIStyle("button"); this.styleButton.alignment = TextAnchor.MiddleLeft; foreach (NmLocalFileList.BundleFileInfo current in this.lstBundleFileInfo) { if (this.CurrentBundleFileInfo == current) { GUILayout.Label(current.strFileName, new GUILayoutOption[0]); } else if (GUILayout.Button(current.strFileName, this.styleButton, new GUILayoutOption[0])) { this.RequestBundelDownload(current); this.CurrentBundleFileInfo = current; } } } GUILayout.EndScrollView(); if (GUILayout.Button("Open Folder", new GUILayoutOption[0])) { this.OpenAssetBundelFolder(); } GUI.DragWindow(); }
private void RequestBundelDownload(NmLocalFileList.BundleFileInfo kBundleFileInfo) { WWWItem wWWItem = Holder.TryGetOrCreateBundle(kBundleFileInfo.strFolderName, null); if (wWWItem == null) { return; } wWWItem.SetItemType(ItemType.USER_ASSETB); wWWItem.SetCallback(new PostProcPerItem(this._OnCompletedDownload), null); TsImmortal.bundleService.RequestDownloadCoroutine(wWWItem, DownGroup.RUNTIME, false); }
private void OpenAssetBundelFolder() { if (string.IsNullOrEmpty(this.strCurrentBundleFolder)) { return; } string[] array = this._GetFiles(this.strCurrentBundleFolder, this.strDefaultSearchPattern, SearchOption.AllDirectories); if (array == null || 0 >= array.Length) { return; } this.lstBundleFileInfo = new List <NmLocalFileList.BundleFileInfo>(); string[] array2 = array; for (int i = 0; i < array2.Length; i++) { string text = array2[i]; FileInfo fileInfo = new FileInfo(text); NmLocalFileList.BundleFileInfo item = new NmLocalFileList.BundleFileInfo(fileInfo.Name, text.Substring(text.IndexOf('\\') + 1)); this.lstBundleFileInfo.Add(item); } this.strCurrentBundleFolder += "/"; Option.localWWW = true; Option.SetProtocolRootPath(Protocol.FILE, "/" + this.strCurrentBundleFolder); }