I want to use scripts that contain values and functions without instantiating them. I have a class and classes derived from that class. I want another script to go over a list which will contain the derived classes, but I don’t know how to do so without making each one into an object, which I don’t want to do both because that would add a lot of work and in just seems unnecessary.
Thanks in advance for any suggestions and advises.
Fairly unclear what you’re trying to do. Several options that might be helpful, depending:
If you don’t want your script to be attached to a Unity GameObject, you can just define a plain old C# class (i.e. don’t inherit from MonoBehaviour).
The words “object” and “instantiate” are also used to describe things you do with plain C# classes, but they don’t mean quite the same thing that they typically do in a Unity context.
If you want to avoid instantiating anything even in the C# sense, you can use static classes or static members.
Also note that Unity has another magical type called ScriptableObject, which is kind of similar to MonoBehaviour except that it gets treated as an asset instead of an object in your scene.