/* * void Update() * { * if(!pumpIsRunning) * return; // Abort * * cur = head; * * while(cur != null) * { * cur.StepAnim(Time.deltaTime); * cur = cur.next; * } * } */ // The coroutine that drives animation: protected static IEnumerator AnimationPump() { #if !USE_DELTA_TIME float startTime = Time.realtimeSinceStartup; float time; #endif float elapsed; SpriteBase next; pumpIsDone = false; while (pumpIsRunning) { #if !PUMP_EVERY_FRAME yield return(new WaitForSeconds(animationPumpInterval)); #else yield return(null); #endif #if USE_DELTA_TIME elapsed = Time.deltaTime; #else time = Time.realtimeSinceStartup; elapsed = time - startTime; startTime = time; #endif // Start at the beginning: cur = head; while (cur != null) { next = (SpriteBase)cur.next; cur.StepAnim(elapsed); cur = next; } } pumpIsDone = true; }
/* void Update() { if(!pumpIsRunning) return; // Abort cur = head; while(cur != null) { cur.StepAnim(Time.deltaTime); cur = cur.next; } } */ // The coroutine that drives animation: protected static IEnumerator AnimationPump() { #if !USE_DELTA_TIME float startTime = Time.realtimeSinceStartup; float time; #endif float elapsed; SpriteBase next; pumpIsDone = false; while (pumpIsRunning) { #if !PUMP_EVERY_FRAME yield return new WaitForSeconds(animationPumpInterval); #else yield return null; #endif #if USE_DELTA_TIME elapsed = Time.deltaTime; #else time = Time.realtimeSinceStartup; elapsed = time - startTime; startTime = time; #endif // Start at the beginning: cur = head; while( cur != null ) { next = (SpriteBase)cur.next; cur.StepAnim(elapsed); cur = next; } } pumpIsDone = true; }