Dear all,
i have an unusal question.
How is a C# class beeing read in Unity?
The question occured since there is the possibility in C# to have a static constructior (which is basically called before a class is instanciated).
My idea is to have a class file which is not attached to the scene but instanciates an gameobject on gamestart (like an overview class that administrates some gameobject-instances).
I don’t like the idea of having a gameobject for this on the scene and attach a script to it just for this purpose.
class Overview
{
// Static variable that must be initialized at run time.
static List gos;
// Static constructor is called at most one time, before any
// instance constructor is invoked or member is accessed.
static Overview()
{
gos = new List<GameObject>();
//gos.Add(Instanciate(Resources.load(...)));
//some other instances
}
}