05.12.2011, 08:27
You can optimize it by finding out the animation ids and checking for these. What you are doing now is getting the animation index, convert it to strings, and compare these strings two times. Just comparing some numbers will be much faster.