I have generic list in some class, myCompany,
public List bookList = new List();
and this booklist will have some elements in it, book’s data.
and I want to show these book’s element’s contents. Lets say 3 books in one page,
but there maybe be 10 books in list, then last page will show only 1 book, other pages show 3 books each.
So I wrote like,
if(myCompany.bookList[pageNum*3-3].Name != ""){
GUILayout.Label(myCompany.bookList[pageNum*3-3].Name);
.....
....
}
but if bookList has 10 books in it, it is not multiple of 3, so if pageNum*3-3 is exceed of number, error occur(Argument is out of range)
then how can I check specific bookList[some] has value or null?
if(myCompany.bookList[pageNum*3-3] != null){
this also produce same error.
Thanks.