public void SetAnimation(string animation)
	{
		AsvarduilSpriteAnimation newAnimation = Animations.FirstOrDefault(a => a.Name == animation);
		if(newAnimation == default(AsvarduilSpriteAnimation))
		{
			DebugMessage("Could not find animation " + animation, LogLevel.LogicError);
		}

		_currentAnimation = newAnimation;
	}
    public void SetAnimation(string animation)
    {
        AsvarduilSpriteAnimation newAnimation = Animations.FirstOrDefault(a => a.Name == animation);

        if (newAnimation == default(AsvarduilSpriteAnimation))
        {
            DebugMessage("Could not find animation " + animation, LogLevel.LogicError);
        }

        _currentAnimation = newAnimation;
    }
	public void Start()
	{
		_workingMaterial = renderer.material;

		if(Animations == null
		   || Animations.Count == 0
		   || Animations[0] == null)
			throw new Exception("An animation system must have at least one animation!");

		_currentAnimation = Animations[0];
	}
    public void Start()
    {
        _workingMaterial = renderer.material;

        if (Animations == null ||
            Animations.Count == 0 ||
            Animations[0] == null)
        {
            throw new Exception("An animation system must have at least one animation!");
        }

        _currentAnimation = Animations[0];
    }
    public void PlaySingleFrame(string animation)
    {
        if (string.IsNullOrEmpty(animation))
        {
            throw new ArgumentException("Must specify an animation.");
        }

        if (_currentAnimation == null ||
            _currentAnimation.Name != animation)
        {
            _currentAnimation = Animations.FirstOrDefault(a => a.Name == animation);
            ResetAnimation();
            DrawCurrentFrame();
            return;
        }

        if (CanChangeFrames)
        {
            IncrementFrame();
            DrawCurrentFrame();
        }
    }
	public void PlaySingleFrame(string animation)
	{
		if(string.IsNullOrEmpty(animation))
			throw new ArgumentException("Must specify an animation.");

		if(_currentAnimation == null
		   || _currentAnimation.Name != animation)
		{
			_currentAnimation = Animations.FirstOrDefault(a => a.Name == animation);
			ResetAnimation();
			DrawCurrentFrame();
			return;
		}

		if(CanChangeFrames)
		{
			IncrementFrame();
			DrawCurrentFrame();
		}
	}