void SetUpProblemObject(ProblemSet problemSet, int index) { Problem problem = problemSet.problemList[index]; int currentStatus = ProblemPrefsUpdater.GetProblemStatus(problemSet.ID, problem.ID); ProblemObject po = problemList[index].GetComponent <ProblemObject>(); Text objectText = problemList[index].GetComponentInChildren <Text>(); objectText.text = problem.Title; po.SetStatus(currentStatus); }
void AddNewProblemObject(int index) { GameObject newProb = Instantiate(problemPrefab); RectTransform tf = newProb.GetComponent <RectTransform>(); ProblemObject po = newProb.GetComponent <ProblemObject>(); newProb.transform.SetParent(problemListContainer.transform, false); tf.anchoredPosition = new Vector3(0, C.P_START_HEIGHT - C.P_PROBDISTANCE * index, 0); po.SetIndex(index); problemList.Add(newProb); }