public void SaveEditData(string filePath, TimeLineData data)
        {
            if (string.IsNullOrEmpty(filePath))
            {
                return;
            }
            if (data == null)
            {
                Debug.LogError("save linedata is null");
                return;
            }
            FileStream   fs = null;
            BinaryWriter bw = null;

            try
            {
                fs = File.Open(filePath, FileMode.Create);
                bw = new BinaryWriter(fs);
                //文件头
                string head = "EditData";
                bw.Write(head);

                if (curData == null)
                {
                    curData          = CreateNewEditData();
                    curData.dataPath = filePath;
                }

                curData.AddLineData(data);
                curData.WriteToBinary(bw);

                bw.Close();
                fs.Close();
            }
            catch (Exception e)
            {
                Debug.LogError(e.Message);
                if (bw != null)
                {
                    bw.Close();
                }
                if (fs != null)
                {
                    fs.Close();
                }
            }
        }
        EditData LoadLineData(string path, bool isJson = true)
        {
            if (isJson)
            {
                return(SaveToJson(path));
            }
            else
            {
                #region binary
                if (File.Exists(path))
                {
                    using (FileStream fs = File.Open(path, FileMode.Open))
                    {
                        BinaryReader br = new BinaryReader(fs);
                        //文件头
                        string head = br.ReadString();
                        if (head != "EditData")
                        {
                            br.Close();
                            fs.Close();
                            return(null);
                        }
                        EditData td = CreateNewEditData();
                        td.dataPath = path;
                        td.ReadFromBinary(br);

                        //结束
                        br.Close();
                        fs.Close();
                        return(td);
                    }
                }
                else
                {
                    FileStream   fs = null;
                    BinaryWriter bw = null;
                    try
                    {
                        fs = File.Open(path, FileMode.Create);
                        bw = new BinaryWriter(fs);
                        //文件头
                        string head = "EditData";
                        bw.Write(head);
                        EditData ed = CreateNewEditData();
                        ed.dataPath = path;
                        ed.WriteToBinary(bw);
                        bw.Close();
                        fs.Close();
                    }
                    catch (Exception e)
                    {
                        Debug.LogError(e.Message);
                        if (bw != null)
                        {
                            bw.Close();
                        }
                        if (fs != null)
                        {
                            fs.Close();
                        }
                    }
                }
                #endregion
            }

            return(null);
        }