protected void Awake() { Object.DontDestroyOnLoad(base.gameObject); base.gameObject.name = "Bootstrap"; BloxGlobal.Create(this.bloxGlobalPrefab); if (!Bootstrap.StartedViaUnityPlayButton) { if (this.startupScenes.Count > 0 && this.startupScenes[0] > 0 && this.startupScenes[0] < SceneManager.sceneCountInBuildSettings) { SceneManager.LoadScene(this.startupScenes[0], LoadSceneMode.Single); } else if (SceneManager.sceneCountInBuildSettings > 1) { SceneManager.LoadScene(1, LoadSceneMode.Single); } else { Debug.LogError("There are no scenes for the Bootstrap to load. You need to add at least one game scene to the Build Settings List or via the Blox Game Systems Window."); } } else { for (int i = 0; i < this.autoloadScenes.Count; i++) { int num = this.autoloadScenes[i]; if (num > 0 && num < SceneManager.sceneCountInBuildSettings) { SceneManager.LoadScene(num, LoadSceneMode.Additive); } } } }
private static void RegisterEventsHandlers() { BloxGlobal.RegisterEventHandlerType("Game Systems/Startup/OnBootstrapDone", typeof(Bootstrap_BloxEventHandler)); BloxGlobal.RegisterEventHandlerType("Game Systems/Startup/OnSpashScreenShown", typeof(SplashScreensManager_BloxEventHandler)); BloxGlobal.RegisterEventHandlerType("Game Systems/Startup/OnSpashScreenHidden", typeof(SplashScreensManager_BloxEventHandler)); BloxGlobal.RegisterEventHandlerType("Game Systems/Startup/OnSpashScreensDone", typeof(SplashScreensManager_BloxEventHandler)); BloxGlobal.RegisterEventHandlerType("Game Systems/AreaTrigger/OnAreaTriggerEnter", typeof(AreaTrigger_BloxEventHandler)); BloxGlobal.RegisterEventHandlerType("Game Systems/AreaTrigger/OnAreaTriggerExit", typeof(AreaTrigger_BloxEventHandler)); BloxGlobal.RegisterEventHandlerType("Game Systems/AreaTrigger/OnAreaTriggerStay", typeof(AreaTrigger_BloxEventHandler)); }
protected void Awake() { Object.DontDestroyOnLoad(base.gameObject); base.gameObject.name = "Bootstrap"; BloxGlobal.Create(this.bloxGlobalPrefab); PropertiesManager.OnBootstrapAwake(); if (!Bootstrap.StartedViaUnityPlayButton) { if (this.startupScenes.Count > 0 && this.startupScenes[0] > 0 && this.startupScenes[0] < SceneManager.sceneCountInBuildSettings) { SceneManager.LoadScene(this.startupScenes[0], LoadSceneMode.Single); } else if (SceneManager.sceneCountInBuildSettings > 1) { SceneManager.LoadScene(1, LoadSceneMode.Single); } else { Debug.LogError("There are no scenes for the Bootstrap to load. You need to add at least one game scene to the Build Settings List or via the Blox Game Systems Window."); } } else { List <int> list = new List <int>(); for (int i = 0; i < SceneManager.sceneCount; i++) { list.Add(SceneManager.GetSceneAt(i).buildIndex); } for (int j = 0; j < this.autoloadScenes.Count; j++) { int num = this.autoloadScenes[j]; if (!list.Contains(num) && num > 0 && num < SceneManager.sceneCountInBuildSettings) { list.Add(num); SceneManager.LoadScene(num, LoadSceneMode.Additive); } } } }