bool EditScript(ScriptInfo info) { if (!info.IsEditFile()) { return(false); } try { string text = File.ReadAllText(info.path); text = text.Replace("\r\n", "\n"); File.WriteAllText(info.path, text, System.Text.Encoding.Unicode); return(true); } catch (System.Exception e) { Debug.LogError(e.Message); return(false); } }
bool EditScript(ScriptInfo info) { if (!info.IsEditFile()) return false; try { string text = File.ReadAllText(info.path); text = text.Replace("\r\n", "\n"); File.WriteAllText(info.path, text, System.Text.Encoding.Unicode); return true; } catch(System.Exception e ) { Debug.LogError(e.Message); return false; } }