Exemple #1
0
    public static SkeletonAnimation CreateSkeAnimFromZip(string fullZipPath)
    {
        FileInfo zipFInfo  = new FileInfo(fullZipPath);
        string   spineName = Path.GetFileNameWithoutExtension(fullZipPath);

        ZipFile  zf         = new ZipFile(fullZipPath);
        ZipEntry jsonEntry  = zf.GetEntry(spineName + ".json");
        ZipEntry atlasEntry = zf.GetEntry(spineName + ".atlas");

        List <ZipEntry> pngEntries = new List <ZipEntry>();
        List <ZipEntry> jpgEntries = new List <ZipEntry>();

        // 将图片加入查找表
        foreach (ZipEntry entry in zf)
        {
            string ext = Path.GetExtension(entry.Name);
            if (ext == ".png")
            {
                pngEntries.Add(entry);
            }
            else if (ext == ".jpg")
            {
                jpgEntries.Add(entry);
            }
        }

        AtlasAsset        atlasAsset        = SpineFileReader.IngestSpineAtlas("man_ok.atlas");
        SkeletonDataAsset skeletonDataAsset = SpineFileReader.IngestSpineProject("man_ok.json", atlasAsset);

        return(SpineFileReader.SpawnAnimatedSkeleton(skeletonDataAsset));
    }
Exemple #2
0
    // Create SkeAnim from File
    public static SkeletonAnimation CreateSkeAnimFromFile()
    {
        AtlasAsset        atlasAsset        = SpineFileReader.IngestSpineAtlas("man_ok.atlas");
        SkeletonDataAsset skeletonDataAsset = SpineFileReader.IngestSpineProject("man_ok.json", atlasAsset);

        return(SpineFileReader.SpawnAnimatedSkeleton(skeletonDataAsset));
    }