public override void update(float time) { List <CCSpriteFrame> list = this.m_pAnimation.getFrames(); int count = list.Count; int num2 = (int)(time * count); if (num2 >= count) { num2 = count - 1; } CCSprite pTarget = (CCSprite)base.m_pTarget; if (!pTarget.isFrameDisplayed(list[num2])) { pTarget.DisplayFrame = list[num2]; } }
public override void update(float time) { List <CCSpriteFrame> pFrames = m_pAnimation.getFrames(); int numberOfFrames = pFrames.Count; int idx = (int)(time * numberOfFrames); if (idx >= numberOfFrames) { idx = numberOfFrames - 1; } CCSprite pSprite = (CCSprite)(m_pTarget); if (!pSprite.isFrameDisplayed(pFrames[idx])) { pSprite.DisplayFrame = pFrames[idx]; } }