using UnityEngine;
using mgaia.Utils;
using mgaia.Utils.Pause;

namespace mgaia.tk2d.Pause
{
    /// <summary>
    /// Plugin de pausa para tk2dSpriteAnimators
    /// </summary>
    /// <owner>Victor</owner>
    public class Tk2dSpriteAnimatorPausableBehaviourGroupPlugin :  BasePausableBehaviourGroupPlugin
    {
        public override void SetPauseState(Component component, bool isPaused)
        {
            tk2dSpriteAnimator spriteAnimator = component as tk2dSpriteAnimator;

            Assert.AssertTrue(spriteAnimator != null, "O componente não é um tk2dSpriteAnimator! Tipo enviado: " + component.GetType().Name);

            if (isPaused)
            {
                spriteAnimator.Pause();
            }
            else
            {
                spriteAnimator.Resume();
            }
        }
    }
}