コード例 #1
0
        public SceneData GetScene(string sceneName)
        {
            InternalSceneData scene          = _sceneLoader.Collection.GetScene(sceneName);
            SceneData         sceneConverted = _marshaller.Unmarshall(scene);

            return(sceneConverted);
        }
コード例 #2
0
ファイル: SceneLoader.cs プロジェクト: LenweSeregon/Scylla
        //=============================================================================//
        //============ 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);
        }
コード例 #3
0
        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]));
        }
コード例 #4
0
        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]));
        }
コード例 #5
0
        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);
        }
コード例 #6
0
 internal static void TriggerOnSceneUnloadedInternal(InternalSceneData sceneData)
 {
     _onSceneUnloadedInternal?.Invoke(sceneData);
 }
コード例 #7
0
 //=============================================================================//
 //============ Lifecycle Methods
 //=============================================================================//
 #region Lifecycle Methods
 public InternalSceneRequestLoad(InternalSceneData sceneData) :
     base(sceneData)
 {
 }
コード例 #8
0
        public SceneData GetLastScene()
        {
            InternalSceneData scene = _sceneLoader.Collection.GetLastScene();

            return(_marshaller.Unmarshall(scene));
        }
コード例 #9
0
 private void OnSceneUnloaded(InternalSceneData sceneData)
 {
     FreeBundleIdentifierNumericIfExists(sceneData.BundleIdentifier);
     _scenes.RemoveAll(scene => scene.SceneName == sceneData.SceneName);
 }
コード例 #10
0
        //=============================================================================//
        //============ Private / Protected Methods
        //=============================================================================//
        #region Private / Protected Methods

        private void OnSceneLoaded(InternalSceneData sceneData)
        {
            _scenes.Add(sceneData);
        }
コード例 #11
0
 //=============================================================================//
 //============ Lifecycle Methods
 //=============================================================================//
 #region Lifecycle Methods
 protected InternalSceneRequest(InternalSceneData sceneData)
 {
     _sceneData = sceneData;
 }