public SceneData GetScene(string sceneName) { InternalSceneData scene = _sceneLoader.Collection.GetScene(sceneName); SceneData sceneConverted = _marshaller.Unmarshall(scene); return(sceneConverted); }
//=============================================================================// //============ Lifecycle Methods //=============================================================================// #region Lifecycle Methods /// <summary> /// Unity's Awake lifecycle /// Will initialize all member's variables and always add the scene containing SceneLoader as the first scene (this one will not be delete in any case) /// </summary> private void Awake() { _currentProcess = null; _collection = new SceneCollection(); InternalSceneData loaderScene = new InternalSceneData(UnityEngine.SceneManagement.SceneManager.GetActiveScene().name, true, false, true, "MainSceneBundle", true); SceneLoaderEvents.TriggerOnSceneLoadedInternal(loaderScene); }
internal override SceneLoaderRequestResult Inspection(SceneCollection collection, bool forceNotSuppressible) { InternalSceneData lastScene = collection.GetLastScene(); bool lastSceneNotSuppressible = lastScene != null && forceNotSuppressible == false && lastScene.IsSuppressible == false; return ((lastSceneNotSuppressible) ? (SceneLoaderConstants.REQUEST_RESULTS[SceneLoaderReturnType.LoadRejectedUnloadLastSceneNotSuppressible]) : (SceneLoaderConstants.REQUEST_RESULTS[SceneLoaderReturnType.Accepted])); }
internal override SceneLoaderRequestResult Inspection(SceneCollection collection, bool forceNotSuppressible) { InternalSceneData lastScene = collection.GetLastScene(); string lastSceneBundleIdentifier = lastScene?.BundleIdentifier; List <InternalSceneData> bundleScenes = collection.GetAllScenesAtBundle(lastSceneBundleIdentifier, _includeMains); bool scenesNotSuppressible = bundleScenes?.Find(scene => scene.IsSuppressible == false) != null; return ((forceNotSuppressible == false && scenesNotSuppressible) ? (SceneLoaderConstants.REQUEST_RESULTS[SceneLoaderReturnType.LoadRejectedUnloadBundleNotSuppressible]) : (SceneLoaderConstants.REQUEST_RESULTS[SceneLoaderReturnType.Accepted])); }
public List <InternalSceneData> GetScenesUntilMarked() { List <InternalSceneData> scenes = new List <InternalSceneData>(); for (int i = _scenes.Count - 1; i >= 0; i--) { InternalSceneData scene = _scenes[i]; if (scene.IsMarked || scene.IsMainScene) { break; } scenes.Add(scene); } return(scenes); }
internal static void TriggerOnSceneUnloadedInternal(InternalSceneData sceneData) { _onSceneUnloadedInternal?.Invoke(sceneData); }
//=============================================================================// //============ Lifecycle Methods //=============================================================================// #region Lifecycle Methods public InternalSceneRequestLoad(InternalSceneData sceneData) : base(sceneData) { }
public SceneData GetLastScene() { InternalSceneData scene = _sceneLoader.Collection.GetLastScene(); return(_marshaller.Unmarshall(scene)); }
private void OnSceneUnloaded(InternalSceneData sceneData) { FreeBundleIdentifierNumericIfExists(sceneData.BundleIdentifier); _scenes.RemoveAll(scene => scene.SceneName == sceneData.SceneName); }
//=============================================================================// //============ Private / Protected Methods //=============================================================================// #region Private / Protected Methods private void OnSceneLoaded(InternalSceneData sceneData) { _scenes.Add(sceneData); }
//=============================================================================// //============ Lifecycle Methods //=============================================================================// #region Lifecycle Methods protected InternalSceneRequest(InternalSceneData sceneData) { _sceneData = sceneData; }