Convert Arrow Key control into Touch Screen Control

HI

I am trying to convert the following code so that I could use touch screen control instead of arrow key.

void ComChangeD()
        {
            if(NESW != 2 && Input.GetKeyDown(KeyCode.UpArrow))
            {
                NESW = 0;
            }
            if (NESW != 3 && Input.GetKeyDown(KeyCode.RightArrow))
            {
                NESW = 1;
            }
            if (NESW != 0 && Input.GetKeyDown(KeyCode.DownArrow))
            {
                NESW = 2;
            }
            if (NESW != 1 && Input.GetKeyDown(KeyCode.LeftArrow))
            {
                NESW = 3;
            }
        }

Do u guys have any idea about it?

In Rogue2D free tutorial there is very fine example about mobile controls and how to “move” them frm KB into touch screen.
https://unity3d.com/ru/learn/tutorials/projects/2d-roguelike-tutorial