Ejemplo n.º 1
0
        public bool Load(string clipName)//不存在文件则返回false
        {
            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)
                {
                    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();
                if (onLoadClip != null)
                {
                    onLoadClip();
                }
                return(true);
            }
            else
            {
                Debug.Log("路径: " + path + " 不存在。");
                return(false);
            }
        }
Ejemplo n.º 2
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);
     }
 }
Ejemplo n.º 3
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);
        }