Hi Guys, I am creating my Quiz App and i was watching some Tutorials.
I really try to find all the informations in Youtube, but I was creating my first Quiz for Computer. Now i want to touch instead of using the Mouse
What do I have to change on my Code. In m Tutorial we was clicking on a text - but now I want to touch on a button with the text.
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class Text1 : MonoBehaviour {
List firstchoice = new List () {“Bonn”,“Paris”,“Casablanca”,“Rom”,“St. Petersburg”};
// Use this for initialization
void Start () {
//GetComponent ().text = firstchoice [0];
}
// Update is called once per frame
void Update () {
if (TextControl.randquestion > -1)
{
GetComponent ().text = firstchoice [TextControl.randquestion];
}
}
void OnMouseDown()
{
TextControl.selectedAnswer = gameObject.name;
TextControl.choiceSelected = “y”;
}
}
would be thankful for your help
Sabrina