Startup Manager

'''Notice: You can set script execution order in Unity 3.4 and newer. Making this system obsolete.'''

There is currently no built-in way to manage the order in which scripts start up. To a certain extent you can get around this by putting more important or prerequisite code into Awake, but this doesn't solve the problem and if you're entirely likely to run into the same problem again.

The startup manager is a singleton class that calls an initialization function on participating objects created in the last frame (or at startup) in the order dictated by their priority variable. Participating classes must be derived from the provided BaseBehaviour class (which in turn derives from MonoBehaviour as per usual). This class registers with the startup manager singleton in Start which then calls Initialize on it at the begining of the next frame (again, in the appropriate order).

The BaseBehaviour.priority member is a float. This was a design decision to allow for plenty of tweaking.

BaseBehaviour derived objects which do not find the StartManager instance (e.g. because it is not present in the scene) will call Initialize themselves in Start

Basic Usage

 * 1. Put StartupManager on a game object in your scene somewhere
 * 2. Derive your scripts (or at least the ones which you need to control the order they start in) from BaseBehaviour instead of MonoBehaviour
 * 3. Profit

BaseBehaviour.cs
Here is an example of a BaseBehaviour derived class.

TestClass.cs
A few things of note:
 * If you define start you'll need to use override in the normal way
 * The member BaseBehaviour._initialized can be checked to see if the object has been initialized
 * _StartupPriority is exposed in the editor so you can change it there for scene/object specific startup priorities
 * Groups of BaseBehaviour derived objects created in a particular frame will be dealt with by StartupManager in the same way as at the start of the scene

Feel free to ask me any questions regarding this script. -Ryan Scott