Hi all,
Having some fun with Spine and the Unity runtimes...
In order to make my download file for mobile smaller, I am putting most of my assets as PNGs and JPGs into the /StreamingAssets folder and create textures and sprites at runtime. E.g. like this:
WWW www = new WWW(textureFile);
yield return www;
Sprite sprite = new Sprite();
sprite = Sprite.Create(www.texture, new Rect(0, 0, 1280, 800), new Vector2(0, 0), 8.0f);
renderer.sprite = sprite;
This allows me to store my (many) textures as JPGs and optimized PNGs. When I store them as textures in Unity, they end up stored much larger.
Now, I want to do the same for my spine skeletons: Instead of creating the spine assets / prefab in the Editor at design time, I would like to create the spine assets and gameobjects at runtime.
Has anyone done this ? Is there code anywhere that I could base my importer on? I just peeked at "SpineEditorUtilities", and see a lot of code and Editor Scripts.
More info why I want to do this:
The main motivation for this approach is to be able to control exactly how texture data is stored and reducing download file size (.e.g. APK file size on Android). (Btw, I'm aware that loading the textures from /StreamingAssets takes longer and that once loaded in memory the textures will use more space than the compressed jpg/png. I'm ok with that. The main goal is to fit the game into the download file.)