I have a script in which assigns itself to static instance.
public static NameOfThisScript me;
public static void doSomethingWithTheListIHave(){
//do stuff with the list I have.
//me.thingsIWantToAdd.doStuff(); like this? or iterate this list? do something.
}
public List<GameObject> thingsIWantToAdd = new List<GameObject>();
void Start () {
me = this;
}
I want to be able to modify “list” in editor; assign stuff to the list of script within an instance in the scene.
So this way I can have some public static function that can be called across all other in which will affect all the instances in the list.
However what if this static script is not called first? Other script that try to call its static function in their own Start will end up getting reference to null. I don’t want that to be the case. So I want to make sure GameObject that has this script gets called first in the world.
Can I do that?