-
-
Save AlexMeesters/5375562a63a9661b263caa46d6cc0b06 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Main : MonoBehaviour | |
{ | |
// Runs before a scene gets loaded | |
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)] | |
public static void LoadMain() | |
{ | |
GameObject main = GameObject.Instantiate(Resources.Load("Main")) as GameObject; | |
GameObject.DontDestroyOnLoad(main); | |
} | |
// You can choose to add any "Service" component to the Main prefab. | |
// Examples are: Input, Saving, Sound, Config, Asset Bundles, Advertisements | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment