NICE! Got it working, it even works with multiple atlases. Thanks for the help
I hardcoded our Tiling to .25f, since all our face sprites are 1024x1024.
The subclass was as simple as this:
public override void SetSprite(tk2dSpriteCollectionData spriteCollection, int spriteId) {
var spr = spriteCollection.spriteDefinitions[spriteId];
var renderer = GetComponent<SkinnedMeshRenderer>();
renderer.material = spr.material;
renderer.material.mainTextureOffset = spr.uvs[0];
}And if you have more than 16 frames, can enable "multiple atlases" and it works great.
There were a couple tweaks I had to make to the source to get everything to work properly.
1. To get the custom inspector for your subclass, set
[CustomEditor(typeof(tk2dSpriteAnimator), true)] in tk2dSpriteAnimatorEditor.cs
2. To stop the sprite from disabling itself, comment out Line 117 in tk2dSpriteAnimator
3. Remove line 137 from tk2dSpriteAnimator to prevent runtime error log
4. To prevent runtime error in editor, change line 259 of tk2dSpriteAnimationClipEditor to
preview.Draw(r, Animator.Sprite? Animator.Sprite.GetCurrentSpriteDef() : null);That's about it. Thanks for the help!
Only one thing remaining as an issue is the packing time... it currently takes close to 30 seconds, to pack 17 1024 textures into 2 atlases, w/ no padding. Any chance this can be expedited?