using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using UnityEngine.EventSystems; public class NewQuestionScript : MonoBehaviour { public GameObject prefab; public Transform contentPanel; QuestionCard questionCard; // Start is called before the first frame update void Start() { GetNewQuestionData(); } private void GetNewQuestionData() { // if new game, create one question card to start with GameObject question = Instantiate(prefab, new Vector2(0, 0), Quaternion.identity) as GameObject; questionCard = question.GetComponent(); questionCard.PrepareQuestion("NewQuestionText", "NewAnswerText"); questionCard.GetQuestion(false); questionCard.transform.SetParent(contentPanel); } }