Пример #1
0
        private void LoadClipsInPath()
        {
            DirectoryInfo dir = new DirectoryInfo(path);

            FileInfo[] fis = dir.GetFiles("*.clip", SearchOption.TopDirectoryOnly);
            clips = new List <Clip>();
            foreach (var fi in fis)
            {
                var c = Serializer.XMLDeSerialize <Clip>(fi.FullName);
                c.clipName = fi.Name.Substring(0, fi.Name.Length - fi.Extension.Length);

                foreach (var curve in c.curves)
                {
                    if (curve.ast == null)
                    {
                        continue;
                    }
                    curve.ast = GetComponent <Avatar>().GetTransDOF(curve.ast.dof);
                }

                ClipTool.GetPairs(c.curves);
                ClipTool.GetFrameRange(c);

                clips.Add(c);
            }
            if (clips.Count > 0)
            {
                SetClip(clipName);
                if (SYS.debugAnime)
                {
                    print(current.clipName + " length: " + current.frameRange.y);
                }
            }
        }
Пример #2
0
        Clip Mirror(Clip clip)
        {
            mirror    = true;
            clip.loop = true;
            PlayIdx(0);
            clip.AddEulerPosAllCurve(80);
            PlayIdx(40);
            clip.AddEulerPosAllCurve(120);
            mirror = false;
            PlayIdx(0);
            clip.AddEulerPosAllCurve(160);

            ScaleClip(clip, 0.5f);

            ClipTool.GetFrameRange(clip);
            return(clip);
        }