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; // Start is called before the first frame update void Start() { NewQuestion newQuestion = GetNewQuestionData(); newQuestion.transform.SetParent(contentPanel); } private NewQuestion GetNewQuestionData() { // if new game, create one question card to start with GameObject question = Instantiate(prefab, new Vector2(0, 0), Quaternion.identity) as GameObject; NewQuestion questionCard = question.GetComponent(); questionCard.PrepareQuestion("NewQuestionText", "NewAnswerText"); questionCard.GetQuestion(false); return questionCard; } }