public void tick() { int i = curAnimations.Count; while (i-- > 0) { if (curAnimations[i] != null && curAnimations[i].tick()) { if (curAnimations[i].callback != null) { curAnimations[i].callback(); } curAnimations.RemoveAt(i); } //print(position); } if (curAnimations.Count == 0) { SmartUILogic.removeActive(this); } setElementToRect(); }