Hey Guys,I'm new to this forum and/but I want a little help and I wanted hear some opinions on something from the community. I'm working on 2 things, One is a binary reader to read the binary files spine can export, I mostly wanted to talk about that. Then I also want to hear opinions to find if anyone is interested in what I'm working on for unity.
Which is basically a skeletle animation support that has each limb or bone a GameObject in unity, Kinda like how if you imported a 3D model with separate parts in it. Its usefulness is very helpful because you can attach skeletons to a bone or scripts or attach hotboxes to each limb! I was wondering if you guys would be okay with that in the regular unity runtime? I'm already done with it and I just have a little cleanup to do to feel comfortable sharing it.
Now the C# binary reader... I want to make it available to everyone because the file size will drastically reduce a games overall size and that it is faster to read/load. I was able to decipher java's decrepit encoding system they call MUTF-8, only halfway.... I can read String, Integers, regular bytes, and some bools.... But no floats, So I need help with that.
using System;
using System.IO;
using System.Collections.Generic;
using System.Resources;
namespace SpineBinary
{
public class SkeletonJson
{
public SkeletonJson(string Location)
{
FileStream SourceStream = File.Open (Location, FileMode.Open);
MiscUtil.IO.EndianBinaryReader reader = new MiscUtil.IO.EndianBinaryReader (MiscUtil.Conversion.EndianBitConverter.Big,SourceStream);
Console.WriteLine("Bones Amount:"+(reader.Read ()-1));
Console.Write ("Bone Name:" + (reader.ReadString ()));
Console.Write (" ParentIndex:"+(reader.ReadInt32()));
Console.Write (" X:"+(reader.ReadSingle() * 1));//Scale is 1 by default
Console.Write (" Y:"+(reader.ReadSingle() * 1));//Scale is 1 by default
Console.Write (" W:"+(reader.ReadSingle()));
Console.Write (" H:"+(reader.ReadSingle()));
Console.ReadLine ();
}
}
public class MainClass
{
public static void Main (string[] args)
{
SkeletonJson Test = new SkeletonJson ("skeleton.skel");
}
}
}
What it feeds out:
Bones Amount:3
Bone Name:root ParentIndex:0 X:0 Y:1 W:1 H:0
Some data is being misplaced here or the reader is reading off all of x as one value and letting Y take W's value(BAD!).
Its supposed to be:
Bones Amount:3
Bone Name:root ParentIndex:0 X:0 Y:0 W:1 H:1
This is just a snippet and you guys need John Skeets MiscUtils Library(just the EndianBinaryReader and maybe his streamer). My plan was to adapt his progress and see if I can make it be a java binary file reader(as in it reads java binary files not it being a java binary reader... its not) for Spine's really nice C# runtime.
But if the spine developers(Nate) could actually export spines binary files in something like BSON or UTF-8 or ASCII... Something that isn't Java's home-made contraption. This would be a none issue and we might get somewhere sooner with this.
Some feed back will be a great help to the spine runtime. So you guys could perhaps get Binary Files read on C# and maybe other languages.