Exemplo n.º 1
0
 public void ConvertToTextComment()
 {
     while (Comment.StartsWith("_"))
     {
         Comment = Comment.Substring(1);
     }
     _lineContent = LineContents.TextComment;
     UpdateAllProperties();
 }
Exemplo n.º 2
0
        public FileItem(Statistic statistic, string comment)
        {
            Comment = comment;

            if (statistic != null)
            {
                this.statistic = statistic;
                _lineContent   = LineContents.Statistic;
            }
            else if (comment.StartsWith("_"))
            {
                _lineContent = LineContents.InvalidStatisticLine;
            }
            else
            {
                _lineContent = LineContents.TextComment;
            }
        }
Exemplo n.º 3
0
    public static bool SaveFile(string fileName)
    {
        string fullPath = directory + fileName + fileExtension;

        string str = "{}";

        if (LineWorld.main.lines.Count > 0)
        {
            LineContents lc = new LineContents();
            lc.lines = LineWorld.main.lines;

            str = JsonUtility.ToJson(lc);
        }

        currentFilename = fileName;

        File.WriteAllText(fullPath, str);
        MessageToast.Show("Save successful");
        return(true);
    }