Currently I have a serializable class called QuestionAnswers with the following :
public string question;
public string[ ] answers;
public int correctAnswer;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[System.Serializable]
public class QuestionAnswers
{
public string question;
public string[ ] answers;
public int correctAnswer;
}
In my normal MonoBehaviour script called ListManager I reference the serializable class called QuestionAnswers as QnA:
public List QnA;
public class ListManager : MonoBehaviour
{
public List QnA;
in the inspector the public List QnA shows as below
My question is how can I change the QnA size value (currently 1, as shown above) and the Answers Size value (currently 4, as shown above) in my ListManger script via an inputfield.text field.
Note that the structure of the List QnA(as shown above) should stay the same as the correct answer value is connected to the answers and the answers is connected to the question.
Example :
When I increase the QnA size value to say 3 the inspector shows following :
(Note the arrows to the left of each element)
when I click on each element the inspector show the following :
(note the arrows to the left of each Answer)
When I click on the Answers the inspector show the following:
(I have added the value 4 next to each Answer in the inspector)
Just to recap on my question :
How can I change the QnA size value (currently 1, as shown above) and the Answers Size value (currently 4, as shown above) in my ListManger script via an inputfield.text field.
Note that the structure of the List QnA(as shown above) should stay the same as the correct answer value is connected to the answers and the answers is connected to the question.