protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, TrackAmplitudes amplitudes) { // assume that if the animation is playing on its own, it's independent from the beat and doesn't need to be touched. if (textureAnimation.FrameCount == 0 || textureAnimation.IsPlaying) { return; } textureAnimation.GotoFrame(currentFrame); currentFrame = (currentFrame + 1) % textureAnimation.FrameCount; }
/// <summary> /// Halt all animations and velocity so the bird will promptly start falling. /// </summary> public void FallDown() { currentVelocity = 0.0f; animation.IsPlaying = false; animation.GotoFrame(2); }