2D Toolkit Forum

2D Toolkit => Support => Topic started by: Trogl on March 31, 2013, 04:39:39 pm

Title: May be bugreport
Post by: Trogl on March 31, 2013, 04:39:39 pm
Hi! It's not a big deal for now but I want to help make t2d better, so:

I created animation collection and then remove one animation from list, and commit changes. And looks like deleted animation not completely removed from animation collection:

(https://dl.dropbox.com/u/5464984/sm/2013-03-31_18-32-05----366x231.jpg)

and when I run this code
Code: [Select]
tk2dSpriteAnimationClip[] clips = mSprite.anim.clips;

        string res = "";
        foreach (var clip in clips)
        {
            res += "|" + clip.name;
        }
        Debug.Log(res);

i has this result:
(https://dl.dropbox.com/u/5464984/sm/2013-03-31_18-33-40----403x32.jpg)

Using 1.92 beta2.

p.s.Animations in attachement.
Title: Re: May be bugreport
Post by: apbilyk on April 04, 2013, 07:40:26 pm
I just ran into this as well, on 1.92 final.
Title: Re: May be bugreport
Post by: unikronsoftware on April 04, 2013, 08:35:23 pm
@Trogl - I wrote up a reply, but I think I have forgotten to click "Post".

Basically, my post said "I tested this, and I couldn't reproduce it."

But now looking at this again, it makes a bit more sense to me why you're experiencing it.
Looking through the code - delete definitely clears the name and stuff. The line in there is because the slot internally is still there.
The clip should be cleared & empty though, so it shouldn't cause any issues, apart from that ugly line in there, and when you iterate through clips, you will find empty clips in there.

The next time you create a clip, it will occupy this slot, though.
So, it isn't really a bug, but not ideal behaviour either. It will change in a future version.
Title: Re: May be bugreport
Post by: Trogl on April 04, 2013, 09:24:42 pm
оk, I was glad to help :)