Showing public class variables in another class in the Inspector.

I have something like this:

public class Student
    int age;
    string name;
    float height;
    float grades[];
public class StudentCollection
     public Student stud1;
     public Student stud2;
     public Student stud3;

Now I want the students to appear in the Inspector like this:

> Stud1
> Stud2
> Stud3

And when I click the arrow of Stud1, it should look like this:

v Stud1
    Age ________
    Name _______
    Height _____
  v Grades
        Size 2
        Element 0 _______________
        Element 1 _______________

> Stud2
> Stud3

Is this possible? T______T Thanks in advance.

You could use Lists for this.

you need something like:

using System.Collections.Generic
class blabla:Monobehaviour
public List<student> studentlist;

IMPORTANT, you also need to add a directive before your Student class, like so

class Student

this way the “studentlist” will work like any other List in the Unity inspector, set size and set properties on elements etc.