I am trying to move the images in the scene through a touch button, i tried something but it doesnt seem to work, and also the the texture doesnt show up on screen.
public Texture2D Button;
// Use this for initialization
void Start () {
guiTexture.texture = Button;
}
// Update is called once per frame
void Update () {
foreach(Touch touch in Input.touches)
{
if(guiTexture.HitTest(touch.position) && touch.phase == TouchPhase.Began)
{
Debug.Log("Touching");
GameManager.a++;
}
else if(guiTexture.HitTest(touch.position) && touch.phase == TouchPhase.Ended)
{
Debug.Log("Not-Touching");
}
}
}