Instantiate an application manager if it's not already in the scene

Hello. How does one go about creating a prefab with an app manager into the scene, when the app manager isn’t already in the scene?

What I want is to have this object created at runtime if it’s not in the scene (when it should be). I’ve already got the object placed in the starting scene and have DontDestroyOnLoad as part of it (so it gets transferred between scenes). But what if I do some work on a different scene and the app manager isn’t there? I know I can have a script in the scene that checks if the app manager is available and instantiate it if it isn’t, but how would one do that from a script in the project view (so I don’t have to put that script into every scene)?

Sounds like your looking for a Singleton

public class Manager {
	
	private static Manager instance;
	
	public static Manager Instance {
		
		get {
			if (instance == null) {
				instance = new Manager ();
			}
			
			return instance;
		}
		
	}
}

Otherwise you would have to attach a script that contains this:

void Start () {

    if (GameObject.Find ("Manager") == null) {
        GameObject manager = Instantiate (Resources.Load ("Manager")) as GameObject;    // Finds it in the resources folder so you don't have to link the manager for every scene.
        manager.name = manager.name.Remove (manager.name.Length-7);    // Gets rid of the (Clone) in the name when instantiated
    }

}

to every scene, as you mentioned.