예제 #1
0
        static public PackFile SaveAnimation(PackFileService pfs, string riderAnimationName, string savePrefix, bool ensureUniqeName, AnimationClip clip, GameSkeleton skeleton)
        {
            var animFile = clip.ConvertToFileFormat(skeleton);
            var bytes    = AnimationFile.GetBytes(animFile);

            string savePath = "";

            if (string.IsNullOrWhiteSpace(savePrefix) == false)
            {
                if (ensureUniqeName)
                {
                    savePath = GenerateNewAnimationName(pfs, riderAnimationName, savePrefix);
                }
                else
                {
                    savePath = Path.GetDirectoryName(riderAnimationName) + "\\" + savePrefix + Path.GetFileName(riderAnimationName);
                }
            }

            return(SaveHelper.Save(pfs, savePath, null, bytes));
        }