using System.Collections; using System.Collections.Generic; using UnityEngine; public class ScrollViewScript : MonoBehaviour { public GameObject prefab; public Transform contentPanel; // Start is called before the first frame update void Start() { SetGiventQuestion(); } public void SetGiventQuestion() { // if new game, create one question card to start with GameObject question = Instantiate(prefab, new Vector2(0,0), Quaternion.identity) as GameObject; QuestionCard questionCard = question.GetComponent(); questionCard.PrepareQuestion(); questionCard.GetQuestion(true); Debug.Log("ScrollView Question start " + questionCard.questionText.text + " questionString " + questionCard.questionString); questionCard.transform.SetParent(contentPanel); } // Update is called once per frame void Update() { } }