Animate Sprites, Very Confused

So with the help of members of the forums I made this script

using UnityEngine;
using System.Collections;

public class ThePlayer : MonoBehaviour 
{
	public enum Directions
	{
		None = 0,
		Left = 1,
		Right = 2,
		Up = 3,
		Down = 4,
		upLeft = 1  3,
		upRight = 2  3,
		downLeft = 1  4,
		downRight = 2  4
	}

	public bool isGrounded;
	
	public float moveSpeed;
	

	// Use this for initialization
	void Start () 
	{
	
	}
	
	// Update is called once per frame
	void Update () 
	{
	float dx = Input.GetAxisRaw("Horizontal") * Time.deltaTime * moveSpeed;
	float dy = Input.GetAxisRaw("Vertical") * Time.deltaTime * moveSpeed;
	var direction = Directions.None;
	transform.Translate(dx,0,dy);
		
		
	if(dx > 0)
		{
			direction = Directions.Right;
			Debug.Log("You Are Moving Right");
		}
		
	else if(dx < 0)
		{
			direction = Directions.Left;
			Debug.Log("You Are Moving Left");
		}
		
	if(dy > 0)
		{
			direction = Directions.Up;
			Debug.Log("You Are Moving Up");
		}
		
	else if(dy < 0)
		{
			direction = Directions.Down;
			Debug.Log("You Are Moving Down");
		}
		
	if(dx > 0  dy > 0 )
		{
			direction = Directions.upRight;
			Debug.Log("You Are Moving Up and Right");
		}
		
	else if(dx < 0  dy > 0 )
		{
			direction = Directions.upLeft;
			Debug.Log("You Are Moving Up and Left");
		}
		
	if(dy < 0  dx > 0 )
		{
			direction = Directions.downRight;
			Debug.Log("You Are Moving Down and Right");
		}
		
	else if(dy < 0  dx < 0 )
		{
			direction = Directions.downLeft;
			Debug.Log("You Are Moving Down and Left");
		}
		
		if(dy == 0  dx == 0)
		{
			direction = Directions.None;
			Debug.Log("You Are Not Moving");
		}	
	}
}

that’s all good my problem is I want where it says something like

if(dy == 0  dx == 0)
		{
			direction = Directions.None;
			Debug.Log("You Are Not Moving");
		}

for it to change the texture on a plane and loop until the condition changes for example, the code I referenced is supposed to play idle animation, I have 6 images which will play the animation, but how to make it where it will change the images in a sequence.

hope it may work…

 else if(dy == 0  dx == 0)

        {

            direction = Directions.None;

            Debug.Log("You Are Not Moving");

        }

lol, don’t think you understood that question.

Essentially you need to make a timer, and every time that timer gets big enough, change the image.

Or:

Makes bitmap fonts AND animated sprites, and includes a simple animating example.

This link may help if you have all of your character animations on seperate rows of the sprite sheet:
http://wiki.unity3d.com/index.php?title=Animating_Tiled_texture_-_Extended

Just adjust the row number to the appropriate animation.