Beispiel #1
0
 public bool Load()
 {
     path = UIClipList.I.clipPath + clipName + ".clip";
     if (System.IO.File.Exists(path))
     {
         _clip          = Serializer.XMLDeSerialize <Clip>(path);
         _clip.clipName = clipName;
         foreach (var curve in _clip.curves)
         {
             //curve.trans = UIDOFEditor.I.avv atar.transform.Search(curve.name);
             var trans = UIDOFEditor.I.avatar.transform.Search(curve.name);
             curve.ast = UIDOFEditor.I.avatar.GetTransDOF(trans);
         }
         ClipTool.GetPairs(_clip.curves);
         ClipTool.GetFrameRange(_clip);
         //PlayerPrefs.SetString("LastOpenClipName", clipName);
         //PlayerPrefs.Save();
         return(true);
     }
     else  // 不存在clip文件则新建一个
     {
         _clip = new Clip(clipName);
         foreach (var ast in UIDOFEditor.I.avatar.data.asts)
         {
             _clip.AddCurve(ast);
         }
         ClipTool.GetPairs(_clip.curves);
         ClipTool.GetFrameRange(_clip);
         //PlayerPrefs.SetString("LastOpenClipName", clipName);
         //PlayerPrefs.Save();
         return(false);
     }
 }
Beispiel #2
0
        public void New(string clipName)
        {
            var c = new Clip(clipName);

            foreach (var ast in UIDOFEditor.I.avatar.data.asts)
            {
                c.AddCurve(ast);
            }
            ClipTool.GetPairs(c.curves);
            ClipTool.GetFrameRange(c);
            PlayerPrefs.SetString("LastOpenClipName", clipName);
            PlayerPrefs.Save();

            path = UIClipList.I.clipPath + clipName + ".clip";
            clip = Serializer.XMLSerialize(c, path);
        }