Static means the field belongs to the Class, not every instance of that class.
You can then access Person.children[…] from anywhere in any other script or just children[…] from within an instance of a Person class and they will all point to a single List.
I meant i want a children list for every person but i dont want a children list for every persons children.
If i make it a static then wouldnt it mean theres 1 child list at all?
Anyways i made a childperson class to wrap things up. and it does the job.
Technically, this shouldn’t be an issue as long as your constructor/awake/start code does not create more person instances.
Generally with this kind of a structure you build/populate it from an external class/script so you don’t have people creating other people all willy nilly (like the 70s).
Having empty List's won’t really cause any issues. The other options is to create a “soft collection” where you have public pointers to other Persons:
public Person parent = null;
public Person firstChild = null;
public Person nextChild = null;
As long as your code reinforces these references then all should be fine. public properties with custom get/set code works wonders here, you can also implement array access […] on top of all this, but that’s kinda overkill IMO, may as well just use a list.