| 123456789101112131415161718192021222324252627282930313233 |
- 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>();
- questionCard.PrepareQuestion();
- questionCard.GetQuestion(true);
- questionCard.SetQuestionSafe();
- questionCard.transform.SetParent(contentPanel);
- }
- // Update is called once per frame
- void Update()
- {
-
- }
- }
|