Hello,
I’m trying to make a List of my own Class. I don’t know how to populate it though, I keep running into Errors. So below is fine, this all displays well in my Inspector, and I can add Elements and it shows fine.
class QUIZ_SUB_QUESTION{
var question : String;
var answers : List.<String>;
var cindex : int;
}
var questions : List.<QUIZ_SUB_QUESTION>;
Now, I want to Add to the List dynamically:
var qList : List.<QUIZ_SUB_QUESTION> = new List.<QUIZ_SUB_QUESTION>();
qList..question = question;
qList.answers = null;
qList.cindex = cindex;
questions.Add(qList);
But I get the errors:
- ‘question’ is not a member of 'System.Collections.Generic.List.
- ‘answers’ is not a member of 'System.Collections.Generic.List.
- ‘cindex’ is not a member of 'System.Collections.Generic.List.
When they clearly are … what am I doing wrong here? Thanks.