Beispiel #1
0
        static void SomeF()
        {
            string folder       = "models/coin/export/";
            string files        = folder + "coin";
            string skelFile     = files + "-pro.skel";
            string atlasFile    = files + ".atlas";
            string jsonSkelFile = files + "-pro.json";


            TexLoader textureLoader = new TexLoader();
            Atlas     atlas         = new Atlas(atlasFile, textureLoader);

            var skeletonBinary     = new SkeletonBinary(new Atlas[] { atlas });
            var skeletonBinaryData = skeletonBinary.ReadSkeletonData(skelFile);
            var jsonSkeletonBinary = JsonConvert.SerializeObject(skeletonBinaryData);

            File.WriteAllText(skelFile + ".json", jsonSkeletonBinary);

            var skeletonJson     = new SkeletonJson(new Atlas[] { atlas });
            var skeletonJsonData = skeletonJson.ReadSkeletonData(jsonSkelFile);
            var jsonSkeletonJson = JsonConvert.SerializeObject(skeletonJsonData);

            File.WriteAllText(jsonSkelFile + ".json", jsonSkeletonJson);
            //Console.WriteLine(json);
        }
Beispiel #2
0
        static SkeletonData GetSkeletonFromJson()
        {
            string folder    = "models/hero/export/";
            string files     = folder + "hero";
            string skelFile  = files + "-pro.skel";
            string atlasFile = files + ".atlas";
            string jsonFile  = files + "-pro.json";


            TexLoader textureLoader = new TexLoader();
            Atlas     atlas         = new Atlas(atlasFile, textureLoader);

            var skeleton     = new SkeletonJson(new Atlas[] { atlas });
            var skeletonData = skeleton.ReadSkeletonData(jsonFile);

            return(skeletonData);
        }
Beispiel #3
0
        static SkeletonData GetSkeletonFromSkel()
        {
            string folder    = "d/";
            string files     = folder + "duli";
            string skelFile  = files + ".skel";
            string atlasFile = files + ".atlas";
            string jsonFile  = files + "-pro.json";


            TexLoader textureLoader = new TexLoader();
            Atlas     atlas         = new Atlas(atlasFile, textureLoader);

            var skeletonBinary     = new SkeletonBinary(new Atlas[] { atlas });
            var skeletonBinaryData = skeletonBinary.ReadSkeletonData(skelFile);

            return(skeletonBinaryData);
        }