/// <summary> /// Deletes a file in the persistant data path. /// </summary> public static void Persistant(this HUMIO.Data.Delete deleteData, string fileName) { var path = HUMIO.PersistantPath(fileName); if (SFile.Exists(path)) { SFile.Delete(path); } }
/// <summary> /// Copies a file from the persistant data path, into the persistant data path, with a new file name; /// </summary> public static void Persistant(this HUMIO.Data.Copy copyData, string fileName, string newFileName) { var path = HUMIO.PersistantPath(fileName); var newPath = HUMIO.PersistantPath(newFileName); if (SFile.Exists(path)) { SFile.Copy(path, newPath); } }
public static GameObject SavePrefabAndSelect(string path, GameObject root) { HUMIO.Ensure(path); var prefabPath = path + ((path[path.Length - 1].ToString() == "/") ? string.Empty : "/") + root.name + ".prefab"; HUMIO.Save(root).Asset(prefabPath, true); GameObject.DestroyImmediate(root); Selection.activeObject = AssetDatabase.LoadAssetAtPath <GameObject>(prefabPath); return(Selection.activeGameObject); }
/// <summary> /// Sets the save to be in the persistant data path. /// </summary> public static HUMIO.Data.Persistant Persistant(this HUMIO.Data.Save saveData, string fileName) { var path = HUMIO.PersistantPath(); if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } return(new HUMIO.Data.Persistant(path, saveData, new HUMIO.Data.Load())); }