2using System.Collections;
3using System.Runtime.InteropServices;
18 public override string tooltip {
get {
return (
""); }
33 StartCoroutine(WebGLSave());
38 dlog.
SetDirectory(System.IO.Directory.GetCurrentDirectory());
48 private void OnSave(
string path)
53 public void Save(
string path)
56 string san = pb_FileUtility.SanitizePath(path);
58 if(!san.EndsWith(
".json") && !san.EndsWith(
".env"))
61 if(!(pb_FileUtility.IsValidPath(san,
".json") || pb_FileUtility.IsValidPath(san,
".env") ))
63 Debug.LogWarning(san +
" is not a valid path.");
73 if (System.IO.File.Exists(san))
82 StartCoroutine(RealSave(san));
87 if(System.IO.File.Exists(path))
88 System.Diagnostics.Process.Start(path);
94 private IEnumerator RealSave(
string san)
96 var currentAction = FindObjectOfType<StartAction>();
99 Debug.LogWarning(
"No actions found, trying to fix it.");
103 currentAction = FindObjectOfType<StartAction>();
106 Debug.LogError(
"No actions found, can't save!");
108 if (currentAction || san.EndsWith(
"env"))
120 pb_FileUtility.SaveFile(san, pb_Scene.SaveLevel());
127 private IEnumerator WebGLSave()
133 Debug.Log(
"Save successful, starting file upload!");
134 StartCoroutine(FindObjectOfType<UploadLevelObjects>().UploadAllFiles());
135 HttpCookie.RemoveCookie(
"unsavedChanges");
136 HttpCookie.RemoveRootCookie(
"unsavedChanges");
IEnumerator RestoreOnly()
void OnStageManagerToggle()
static Controller Instance
void ClickedOn(string id)
string filePattern
If isFileBrowser is true, this string my be used to filter file results (see https://msdn....
void AddOnSaveListener(Callback< string > listener)
void SetDirectory(string directory)
static void SetTitle(string title)
static void SetContent(GameObject prefab)