public IVIEntry CopyTo(IVIDirectory target) { try { string tmppath = Path.Combine(target.FullPath, Systemfile.Name); Debug.Log(FullPath + " ==filecpy==> " + tmppath); IVIFile cpy = new IVIFile(Systemfile.CopyTo(tmppath, true)); target.Entries.Add(cpy); return(cpy); } catch (Exception e) { Debug.Log("Failed to copy file \"" + Systemfile.FullName + "\" : " + e.ToString()); } return(null); }
public void SetMaterial() { if (Entry is IVIDirectory) { return; } IVIFile file = Entry as IVIFile; string NameMat = file.Type.ToString(); Material mat = Resources.Load <Material>("Materials/" + NameMat); Renderer rend = GetComponent <Renderer> (); rend.material = mat; }
void Start() { CutDirSrc = new IVIDirectory(CutDirSrcPath, 0); CutDirDst = new IVIDirectory(CutDirDstPath, 0); CpyDirSrc = new IVIDirectory(CpyDirSrcPath, 0); CpyDirDst = new IVIDirectory(CpyDirDstPath, 0); CutFileSrc = new IVIFile(CutFileSrcPath); CpyFileSrc = new IVIFile(CpyFileSrcPath); CutFileDst = new IVIDirectory(CutFileDstPath, 0); CpyFileDst = new IVIDirectory(CpyFileDstPath, 0); CutDirSrc.CutTo(CutDirDst); CpyDirSrc.CopyTo(CpyDirDst); CutFileSrc.CutTo(CutFileDst); CpyFileSrc.CopyTo(CpyFileDst); }
void LogDentries() { foreach (IVIEntry entry in dir.Entries) { if (entry is IVIDirectory) { IVIDirectory edir = entry as IVIDirectory; Debug.Log(edir.Systemdirectory.FullName); } else { IVIFile efile = entry as IVIFile; Debug.Log(efile.Systemfile.FullName); } } }
public long GetLength() { long size = 0; foreach (var element in Entries) { if (element is IVIDirectory) { IVIDirectory elt = element as IVIDirectory; size += elt.GetLength(); } else { IVIFile elt = element as IVIFile; size += elt.Systemfile.Length; } } return(size); }
private void HighightFocus() { if (Focus == null) { FocusDisplayName.text = ""; FocusDisplayPath.text = ""; return; } string DisplayName = ""; string DisplayPath = ""; if (Focus.GetComponent <IVIStar> () != null) { if (Focus.GetComponent <IVIStar> ().Entry is IVIFile) { IVIFile file = Focus.GetComponent <IVIStar> ().Entry as IVIFile; DisplayName = file.Systemfile.Name; DisplayPath = file.Systemfile.FullName; } else { IVIDirectory file = Focus.GetComponent <IVIStar> ().Entry as IVIDirectory; DisplayName = file.Systemdirectory.Name; DisplayPath = file.Systemdirectory.FullName; } } else if (Focus.GetComponent <IVIMascotBehaviour> () != null) { IVISession.Mascot.ActivateModesWheel(); } else { DisplayName = Focus.name; DisplayPath = ""; } FocusDisplayName.text = DisplayName; FocusDisplayPath.text = DisplayPath; }
private void InstantiateStarSystem(Transform parent, IVIDirectory directory, int depth) { foreach (IVIEntry element in directory.Entries) { Transform currentChild = Instantiate(StarPrefab, parent.position, Quaternion.identity, parent); currentChild.gameObject.GetComponent <IVIStar> ().Entry = element; if (element is IVIDirectory) { IVIDirectory childInfo = element as IVIDirectory; currentChild.gameObject.name = childInfo.Systemdirectory.Name; if (depth > 0) { InstantiateStarSystem(currentChild, childInfo, depth - 1); } } else { IVIFile childInfo = element as IVIFile; currentChild.gameObject.name = childInfo.Systemfile.Name; } } }
public void InitChildren(int depth) { depth--; if (depth >= 0) { string[] subdirectories = Directory.GetDirectories(Systemdirectory.FullName); string[] files = Directory.GetFiles(Systemdirectory.FullName); UnityEngine.Assertions.Assert.IsNotNull(this.Entries); this.Entries.Clear(); if (subdirectories.Length >= 1) { foreach (string element in subdirectories) { IVIDirectory subdir = new IVIDirectory(element, depth); bool isHidden = (subdir.Systemdirectory.Attributes & FileAttributes.Hidden) == FileAttributes.Hidden; if (!isHidden || IVISession.DisplayHiddenFiles) { this.Entries.Add(subdir); } } } if (files.Length >= 1) { foreach (string element in files) { IVIFile file = new IVIFile(element); bool isHidden = (file.Systemfile.Attributes & FileAttributes.Hidden) == FileAttributes.Hidden; if (!isHidden || IVISession.DisplayHiddenFiles) { this.Entries.Add(file); } } } } }