Is there a way to execute a piece of code at the startup of the level/scene, without attaching it to a particular game object?
I’d like to avoid the possibility of game designers etc accidentally screwing things up and not knowing why. So certain bits of code should always run, and run only once.
You have to have at least one game object in your scene. Unity doesn’t call main() like most .Net programs do. So you have to have at least one game object that serves as an entry point for your code. It can call a static method if you want it to, but you need one instance to start the game.