public static void LoadLevel(string levelName, LoadSceneMode loadMode) { SceneManager.LoadScene("99_LoadingScreen"); PlayerPrefs.SetString(EnumUtils.NEXTLEVEL.ToString(), levelName); PlayerPrefs.SetInt(EnumUtils.LOADLEVELMODE.ToString(), loadMode == LoadSceneMode.Additive ? 1 : 0); PlayerPrefs.Save(); }
void Awake() { if(PlayerPrefs.HasKey(EnumUtils.NEXTLEVEL.ToString())) { nextLevelName = PlayerPrefs.GetString(EnumUtils.NEXTLEVEL.ToString()); } if(PlayerPrefs.HasKey(EnumUtils.LOADLEVELMODE.ToString())) { loadMode = PlayerPrefs.GetInt(EnumUtils.LOADLEVELMODE.ToString()) == 1 ? LoadSceneMode.Additive : LoadSceneMode.Single; } thisAnimator = GetComponent<Animator>(); }
void LoadSceneInternal( string sceneName, LoadSceneMode loadMode, LoadSceneContainerMode containerMode, Action<DiContainer> preBindings, Action<DiContainer> postBindings) { if (loadMode == LoadSceneMode.Single) { Assert.IsEqual(containerMode, LoadSceneContainerMode.None); } if (containerMode == LoadSceneContainerMode.None) { SceneContext.ParentContainer = null; } else if (containerMode == LoadSceneContainerMode.Child) { SceneContext.ParentContainer = _sceneContainer; } else { Assert.IsEqual(containerMode, LoadSceneContainerMode.Sibling); SceneContext.ParentContainer = _sceneContainer.ParentContainer; } SceneContext.BeforeInstallHooks = preBindings; SceneContext.AfterInstallHooks = postBindings; Assert.That(Application.CanStreamedLevelBeLoaded(sceneName), "Unable to load scene '{0}'", sceneName); SceneManager.LoadScene(sceneName, loadMode); // It would be nice here to actually verify that the new scene has a SceneContext // if we have extra binding hooks, or LoadSceneContainerMode != None, but // it doesn't seem like we can do that immediately after calling SceneManager.LoadScene }
void OnSceneLoaded(Scene scene, LoadSceneMode mode) { //! this gets called AFTER a Scene is completely loaded //: to asure that all Objects are findable getSceneRelevantObj(); }
// Callback made to replace obsolete method OnLevelWasLoaded(int) void OnSceneFinishedLoading(Scene currentScene, LoadSceneMode mode) { this.ResetTriggerTouches(); }
public int LoadGeovoxScene( string path, LoadSceneMode mode = LoadSceneMode.All, string overrideUserDataHomeFolder = "" ){ bundlesLoading = 0; print ("Load Path: " + path); SetCurrentActiveSceneName( Main.TrimEndFromString(Path.GetFileName(path), ".agfs") ); string loadString = File.ReadAllText (path); string[] split = loadString.Split( new char[]{'!'} ); int index = -1; scenePath = path; bundleString = split [++index].Replace("<Alt1>","!"); settingsString = split [++index].Replace("<Alt1>","!"); voxelString = split[++index].Replace("<Alt1>","!"); loadingGeovox = true; return AGF_ReturnCode.Success; }
void SceneIsLoaded(Scene scene, LoadSceneMode mode) { isLoading = false; }
void AutoSave(Scene scene, LoadSceneMode loadMode) { if(!_reloading){ if(scene.name != "intro") StartCoroutine(SaveAfterNewLevel()); } else { _reloading = false; } }
public IEnumerator LoadSceneAsync(string scenePath, LoadSceneMode mode = LoadSceneMode.Single) { #if UNITY_EDITOR if (AssetBundleUtility.SimulateAssetBundleInEditor) { string path = Path.Combine(AssetBundleUtility.AssetBundleResourcesPath, scenePath) + ".unity"; if (mode == LoadSceneMode.Single) { yield return EditorApplication.LoadLevelAsyncInPlayMode(path); } else { yield return EditorApplication.LoadLevelAdditiveAsyncInPlayMode(path); } yield break; } #endif yield return StartCoroutine(LoadAssetBundleWithDependenciesAsync(scenePath + AssetBundleUtility.AssetBundleExtension)); LoadSceneAsyncOpe = SceneManager.LoadSceneAsync(Path.GetFileName(scenePath), mode); yield return LoadSceneAsyncOpe; LoadSceneAsyncOpe = null; }
/// <inheritdoc /> public async Task LoadContent(string sceneToLoad, LoadSceneMode mode = LoadSceneMode.Additive, SceneActivationToken activationToken = null) { await LoadContent(new string[] { sceneToLoad }, mode, activationToken); }
private void LevelWasLoaded(Scene scene, LoadSceneMode mode) { StopAllCoroutines(); StartCoroutine(lateAwake()); }
/// <summary> /// Whenever a new level/scene is loaded, it should be faded in. /// </summary> private void OnNewLevelLoaded(Scene scene, LoadSceneMode mode) { FadeIn(); }
private void SceneManagerOnSceneLoaded(Scene newScene, LoadSceneMode mode) { SharedCoroutineStarter.instance.StartCoroutine(SetCameraCullingMask()); }
/// <summary> /// /// </summary> #if UNITY_5_4_OR_NEWER protected void OnLevelLoad(Scene scene, LoadSceneMode mode)
private void OnSceneLoaded(Scene scene, LoadSceneMode mode) { LevelManager.LevelM.BeginFade(-1); }
private void IniciarCarregamentoComComuns(Scene arg0, LoadSceneMode arg1) { SceneManager.sceneLoaded -= IniciarCarregamentoComComuns; loadBar = FindObjectOfType <LoadBar>(); ComunsCarregado(); }
private static IEnumerator startLoad(string scenename,LoadSceneMode mode,params Action[] acts) { DoneFadeIn = false; FadeCamera.Instance.FadeOut(fadetime, () => { foreach (Action act in acts) { act(); } LoadLevel(scenename, mode); }); yield return new WaitUntil(() => { //Debug.LogFormat("{0} is Loaded:{1}",scenename, SceneManager.GetSceneByName(scenename).isLoaded); return SceneManager.GetSceneByName(scenename).isLoaded; }); GlobalGameInformation.CurrentSceneName = scenename; yield return new WaitUntil(() => { return DoneFadeIn; }); FadeCamera.Instance.FadeIn(fadetime*2, () => { Debug.Log("FadeIn. "); }); }
/// <inheritdoc /> public async Task LoadContentByTag(string tag, LoadSceneMode mode = LoadSceneMode.Additive, SceneActivationToken activationToken = null) { await LoadContent(profile.GetContentSceneNamesByTag(tag), mode, activationToken); }
private void sceneWasLoaded(Scene scene, LoadSceneMode mode) { this.skipFrame = true; }
private static void OnSceneLoaded(Scene scene, LoadSceneMode loadSceneMode) { InitializeWithScene(); }
private static void Internal_SceneLoaded(Scene scene, LoadSceneMode mode) { if (sceneLoaded != null) { sceneLoaded(scene, mode); } }
void OnLevelLoadedEffect(Scene scene, LoadSceneMode mode) { //TODO : 레벨 로딩 단계적으로 하기 GameObject.Find("SceneManager").GetComponent<SceneChangeScript>().BeginFade(-1); }
private void CarregouComuns(Scene arg0, LoadSceneMode arg1) { ComunsCarregado(); }
private void OnSceneLoaded(Scene scene, LoadSceneMode loadSceneMode) { RefreshAudioListener(); }
public void OnSceneWasLoaded(Scene scene, LoadSceneMode m) { OnSceneLoaded(); }
void OnLevelFinishedLoading(Scene scene, LoadSceneMode mode) { currentLevel++; sceneToLoadNext = "Level" + currentLevel + affix; Debug.Log("Next level to load " + sceneToLoadNext); }
void OnSceneLoaded(Scene scene, LoadSceneMode mode) { OnLevelLoaded(scene.buildIndex); }
void OnSceneLoaded(Scene scene, LoadSceneMode mode) { Debug.Log("OnSceneLoaded: " + scene.name); activeCheckpoint = new Vector3(0, 0); }
public static AsyncOperation AsyncLoadLevel(int levelIndex, LoadSceneMode loadMode = LoadSceneMode.Single) { return SceneManager.LoadSceneAsync(levelIndex, loadMode); }
void SetActiveScene(Scene scene, LoadSceneMode mode) { SceneManager.SetActiveScene(scene); SceneManager.sceneLoaded -= SetActiveScene; }
void SceneLoaded(Scene scene, LoadSceneMode mode) { Bugsnag.Context = scene.name; }
// OnLevelWasLoaded is called when a level is loaded. It takes a loaded level index (int) asa parameter so you can limit the fade in to certain scenes void OnLevelFinishedLoading(Scene scene, LoadSceneMode mode) { BeginFade(-1); }
public static void LoadLevel(string scenename, LoadSceneMode mode) { Debug.LogFormat("Load a {0}",scenename); SceneManager.LoadScene(scenename, mode); }
private async void OnSceneLoaded(UnityEngine.SceneManagement.Scene _scene, LoadSceneMode _mode) { if (m_TargetScene == SceneType.None) { return; } SceneType _sceneType = StringToSceneType(_scene.name); if (m_TargetScene != _sceneType) { return; } if (m_SceneLoadDelegate != null) { try { m_SceneLoadDelegate(_sceneType); } catch (System.Exception) { LogWarning("Unable to respond with sceneLoadDelegate after scene [" + _sceneType + "] loaded."); } } if (m_LoadingPage != null) { //await Task.Delay(1000); menu.TurnPageOff(m_LoadingPage); } m_SceneIsLoading = false; }
private void OnSceneLoad(Scene scene, LoadSceneMode mode) { for (var i = recycleBinCollection.Count - 1; i >= 0; i--) { if (!recycleBinCollection[i].persistBetweenScenes) removeRecycleBin(recycleBinCollection[i]); } }
private void OnSceneLoaded(Scene scene, LoadSceneMode mode) { InitializeLevel(); }
void SceneManager_sceneLoaded(Scene scene, LoadSceneMode loadSceneMode) { Debug.Log("Scene loaded"); calculateCurrentAcreCoords(playerController.mainMember.transform.position); updateAcreText(); loadAcresAround(); }
void OnSceneLoaded(Scene scene, LoadSceneMode mode) { animator.ResetTrigger("FadeTo"); animator.SetTrigger("FadeFrom"); }
private void OnSceneLoaded(Scene scene, LoadSceneMode mode) { NetworkLobbyManager singleton = NetworkManager.singleton as NetworkLobbyManager; if (((singleton == null) || (scene.name != singleton.lobbyScene)) && base.isLocalPlayer) { this.SendSceneLoadedMessage(); } }
void UpdateDayNight(Scene scene, LoadSceneMode loadMode) { SetAnimBasedOnCurrentTime(_currentTime); RefreshSkybox(); }
private void LevelWasLoaded(Scene scene, LoadSceneMode mode) { TouchManager.Instance.AddLayer(layer, 0); }
private void SceneManager_sceneLoaded(Scene arg0, LoadSceneMode arg1) { SetMusicPlayer(arg0.buildIndex); }
private void SceneManager_sceneLoaded(Scene arg0, LoadSceneMode arg1) { throw new System.NotImplementedException(); }
private void TatudoCarregado(Scene arg0, LoadSceneMode arg1) { TatudoCarregado(); }
private void OnSceneLoadedEventHandler(Scene scene, LoadSceneMode mode) { // Make sure the engine isn't paused on a scene change! // dERP. Time.timeScale = 1.0f; }
private void SceneLoaded(Scene scene, LoadSceneMode mode) { fade.FadeToNone(); }
/// <summary> /// 场景名字大小写敏感,坑~ /// </summary> /// <param name="scenePath"></param> /// <param name="mode"></param> public void LoadScene(string scenePath, LoadSceneMode mode = LoadSceneMode.Single) { #if UNITY_EDITOR if (AssetBundleUtility.SimulateAssetBundleInEditor) { string path = Path.Combine(AssetBundleUtility.AssetBundleResourcesPath, scenePath) + ".unity"; if (mode == LoadSceneMode.Single) { EditorApplication.LoadLevelInPlayMode(path); } else { EditorApplication.LoadLevelAdditiveInPlayMode(path); } return; } #endif LoadAssetBundleWithDependencies(scenePath + AssetBundleUtility.AssetBundleExtension); SceneManager.LoadScene(Path.GetFileName(scenePath), mode); }
void CallbackOverworld(Scene scene, LoadSceneMode mode) { OverworldManager.instance.SpawnPlayer(); SceneManager.sceneLoaded -= CallbackOverworld; }
private void OnSceneLoaded(Scene scene, LoadSceneMode sceneMode) { if (instance != this) { return; } if (androidUIResizeMode == AndroidUIResizeMode.ResizeCamera || androidUIResizeMode == AndroidUIResizeMode.ResizeCameraAndReferenceResolution) { Camera.main.pixelRect = new Rect(0, 0, Screen.width, Screen.height - webViewHeight); } if (androidUIResizeMode == AndroidUIResizeMode.ResizeCameraAndReferenceResolution) { UnityEngine.UI.CanvasScaler[] allCanvasScalers = GameObject.FindObjectsOfType<UnityEngine.UI.CanvasScaler> (); for (int i = 0; i < allCanvasScalers.Length; ++i) { allCanvasScalers[i].referenceResolution = new Vector2 (allCanvasScalers[i].referenceResolution.x, allCanvasScalers[i].referenceResolution.y / (allCanvasScalers[i].referenceResolution.y - webViewHeight) * allCanvasScalers[i].referenceResolution.y); } } }
private void OnSceneLoaded(Scene scene, LoadSceneMode mode) { actionStates = new Dictionary <string, int>(); }
public int LoadScene( string filename, LoadSceneMode mode = LoadSceneMode.All, string overrideUserDataHomeFolder = "" ){ int returnCode = AGF_ReturnCode.Success; m_LoadSceneMode = mode; m_SceneLoaded = false; string[] split = filename.Split ( new char[]{'/'} ); // string projectName = split[split.Length-3]; string projectFolder = ""; for ( int i = 0; i < split.Length-2; i++ ){ projectFolder += split[i] + "/"; } projectFolder = Main.TrimEndFromString( projectFolder, "/" ); print ( "Now loading: " + projectFolder ); // set the project directory to this folder. SetCurrentProjectDirectory( projectFolder ); SetCurrentActiveSceneName( Main.TrimEndFromString(split[split.Length-1], ".agfs") ); // read the filestring, and decrypt it. string fileString = ""; string encryptedFileString = File.ReadAllText(filename); // if ( useEncryption ){ // fileString = RijndaelSimple.Decrypt(encryptedFileString); // } else { fileString = encryptedFileString; // } int index = 0; string[] fileStrings = fileString.Split ( new char[]{':'} ); print ( string.Format ("Scene Version number = {0}", fileStrings[0]) ); if ( fileStrings[0].CompareTo(versionNumber) != 0 ){ // the version number is different. print an error message, for now. // EventManager.InformLoadFailure(); // m_SceneLoaded = null; LatestErrorMessage = "Error: Attempting to load a scene from an earlier version of the tool. Abort."; print ( LatestErrorMessage ); // return AGF_ReturnCode.VersionMismatch; } // test to see if a prefabs folder exists. if ( System.IO.Directory.Exists( m_CurrentProjectDirectory + "/Prefabs" ) == false ){ if ( System.IO.Directory.Exists ( m_CurrentProjectDirectory + "/Models" ) == true ){ // !BC System.IO.Directory.Move ( m_CurrentProjectDirectory + "/Models", m_CurrentProjectDirectory + "/Prefabs" ); } else { // m_SceneLoaded = null; LatestErrorMessage = "Error: Prefab folder does not exist within " + m_CurrentProjectDirectory ; print ( LatestErrorMessage ); // return AGF_ReturnCode.MissingModelFolder; } } // first, save the grid dimensions. float dimension; bool result = float.TryParse(fileStrings[++index], out dimension); // second, set the atmosphere info. AGF_AtmosphereManager atmosphereManager = GameObject.Find ("AGF_AtmosphereManager").GetComponent<AGF_AtmosphereManager>(); atmosphereManager.SetFogFromString( fileStrings[++index] ); atmosphereManager.SetLightFromString( fileStrings[++index] ); // clear out all bundles. UnloadAllUserBundles(); string userDataHomeFolder = (overrideUserDataHomeFolder != "") ? overrideUserDataHomeFolder : Main.GetUserDataHomeFolder(); // attempt to load all asset bundles that the scene relies on. print ("Required Asset Bundles:"); string[] requiredBundles = fileStrings[++index].Split ( new char[]{'*'} ); m_RequiredBundlesForLoadScene = new List<string>(); bool allBundlesLoaded = true; if ( requiredBundles[0] != "" ){ for ( int i = 0; i < requiredBundles.Length; i++ ){ print (requiredBundles[i]); if ( File.Exists( userDataHomeFolder + "/Asset Packs/" + requiredBundles[i] ) == false ){ // m_RequiredBundlesForLoadScene = new string[0]; // m_SceneLoaded = null; LatestErrorMessage = "Asset Bundle missing: " + userDataHomeFolder + "/Asset Packs/" + requiredBundles[i]; print ( LatestErrorMessage ); // return AGF_ReturnCode.AssetBundleDoesNotExist; } else{ m_RequiredBundlesForLoadScene.Add(requiredBundles[i]); bool bundleNotYetLoaded = LoadAssetBundle( userDataHomeFolder + "/Asset Packs/" + requiredBundles[i] ); if ( bundleNotYetLoaded ) allBundlesLoaded = false; } } } // we will have to wait until this load is complete before moving forward. store the remaining filestring into a temp variable. m_RemainingSceneLoadString = ""; for ( int i = ++index; i < fileStrings.Length; i++ ){ m_RemainingSceneLoadString += fileStrings[i] + ":"; } m_RemainingSceneLoadString.TrimEnd(':'); if ( allBundlesLoaded ){ // we can immediately proceed if no bundles need loading. m_RequiredBundlesForLoadScene = new List<string>(); returnCode = FinishLoadScene(); } return returnCode; }
public void StartFadeIn(Scene scene, LoadSceneMode mode) { fadeCanvas = Instantiate(Resources.Load <GameObject>("Prefabs/FadeCanvas")); fadeImage = fadeCanvas.transform.Find("Image").GetComponent <Image> (); StartCoroutine(FadeIn()); }
void InitBC(Scene scene, LoadSceneMode loadMode = LoadSceneMode.Single) { Climb(false); if(gameObject.CompareTag("Player")){ EnableControls(); CameraManager.Instance.SetFirstPersonCamera(true); } ActivateRagDoll(false); if(vitae <= 0f) SetVitae(.5f); if(scene.name == "Montreal"){ if(kind == Kind.vampire){ GameSettings.updateGS += ApplySunDamage; } } }
public LoadSceneVO(string sceneName, LoadSceneMode mode, bool async) { this.SceneName = sceneName; this.Mode = mode; this.Async = async; }
void OnSceneLoaded(Scene scene, LoadSceneMode mode) { }
// This is called each time a scene is loaded. static private void OnSceneLoaded(Scene arg0, LoadSceneMode arg1) { instance.level++; instance.InitGame(); }
public static AsyncOperation AsyncLoadLevel(string levelName, LoadSceneMode loadMode = LoadSceneMode.Single) { return SceneManager.LoadSceneAsync(levelName, loadMode); }
void StartClimate(Scene scene, LoadSceneMode mode) { CancelInvoke(); if(scene.name == "Montreal"){ InvokeRepeating("UpdateClimate", 5f, climateInterval); } else { UpdateTemperature(climatesDict["sunny"]); } }
protected virtual void OnSceneLoaded(Scene scene, LoadSceneMode mode) { // Ignore additive scene loads if (mode == LoadSceneMode.Additive) { return; } // We first assume that this is a 'normal' scene load rather than a saved game being loaded. // If we subsequently receive a notification that a saved game was loaded then the load action // set here will be overridden by the OnSavePointLoaded callback above. if (loadAction == null) { loadAction = ExecuteStartBlock; } }
public void OnSceneLoaded(Scene scene, LoadSceneMode sceneMode) { }