示例#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);
            }
        }
示例#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);
     }
 }
示例#3
0
        public void InsertKey()
        {
            switch (insertType)
            {
            case InsertKeyType.EulPos: UIClip.I.clip.AddEulerPosAllCurve(frameIdx); break;

            case InsertKeyType.Eul: break;

            case InsertKeyType.Pos: break;

            default: throw null;
            }
            ClipTool.GetFrameRange(UIClip.I.clip);
        }
示例#4
0
        public void RemoveKeyAt(float time)
        {
            switch (insertType)
            {
            case InsertKeyType.EulPos: UIClip.I.clip.RemoveEulerPosAllCurve(time); break;

            case InsertKeyType.Eul: break;

            case InsertKeyType.Pos: break;

            default: throw null;
            }
            ClipTool.GetFrameRange(UIClip.I.clip);
        }
示例#5
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);
        }
示例#6
0
        void ApplyTo60Fps()
        {
            var ratio = 60f / SYS.Fps;

            foreach (var curveObj in UIClip.I.clip.curves)
            {
                foreach (var curve in curveObj.curves)
                {
                    foreach (var key in curve)
                    {
                        key.time = Mathf.RoundToInt(key.time * ratio);
                    }
                }
            }
            ClipTool.GetFrameRange(UIClip.I.clip);
            UITimeLine.I.frameIdx_F *= ratio;
            inputfieldFps.text       = "60";
        }