/// <summary> /// Dessiner sur scène /// </summary> /// <param name="animatedObjectToDraw"></param> public virtual void Draw(VO_AnimatedSprite animatedObjectToDraw) { //Cas particulier de l'animation if (animatedObjectToDraw != null && animatedObjectToDraw.Sprite != null && animatedObjectToDraw.Sprite.Image != null) { //Si l'animation est conforme, on l'affiche _SpriteBatch.Draw(animatedObjectToDraw.Sprite.Image, animatedObjectToDraw.Sprite.Destination, animatedObjectToDraw.Sprite.Source, Color.White); animatedObjectToDraw.GetNextSprite(); } else if (animatedObjectToDraw != null && animatedObjectToDraw.Sprite != null && animatedObjectToDraw.Sprite.Image != null) { //Si les ressources ont été détruites, on regénére l'animation animatedObjectToDraw.RegenerateAnim(); _SpriteBatch.Draw(animatedObjectToDraw.Sprite.Image, animatedObjectToDraw.Sprite.Destination, animatedObjectToDraw.Sprite.Source, Color.White); } }
/// <summary> /// Dessiner sur scène /// </summary> /// <param name="animatedObjectToDraw"></param> public virtual void Draw(VO_AnimatedSprite animatedObjectToDraw, bool animate) { //Cas particulier de l'animation if (animatedObjectToDraw != null && animatedObjectToDraw.Sprite != null && animatedObjectToDraw.Sprite.Image != null) { //Si l'animation est conforme, on l'affiche Draw(animatedObjectToDraw.Sprite); if (animate) { animatedObjectToDraw.GetNextSprite(); } } else if (animatedObjectToDraw != null && animatedObjectToDraw.Sprite != null && animatedObjectToDraw.Sprite.Image != null) { //Si les ressources ont été détruites, on regénére l'animation animatedObjectToDraw.RegenerateAnim(); Draw(animatedObjectToDraw, animate); } }