Пример #1
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]));
        }
        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]));
        }
Пример #3
0
        //=============================================================================//
        //============ Internal Methods
        //=============================================================================//
        #region Internal Methods
        internal override Queue <InternalSceneRequest> CreateRequests(SceneCollection collection, bool forceNotSuppressible)
        {
            if (Inspection(collection, forceNotSuppressible).IsSuccess == false)
            {
                Debug.LogError("Development error -- Contact developer -- Initial inspection went wrong, this request should have been denied");
                return(null);
            }

            Queue <InternalSceneRequest> requests = new Queue <InternalSceneRequest>();

            requests.Enqueue(new InternalSceneRequestUnload(collection.GetLastScene()));
            return(requests);
        }
        //=============================================================================//
        //============ Public Methods
        //=============================================================================//
        #region Public Methods
        internal override Queue <InternalSceneRequest> CreateRequests(SceneCollection collection, bool forceNotSuppressible)
        {
            if (Inspection(collection, forceNotSuppressible).IsSuccess == false)
            {
                Debug.LogError("Development error -- Contact developer -- Initial inspection went wrong, this request should have been denied");
                return(null);
            }

            Queue <InternalSceneRequest> requests = new Queue <InternalSceneRequest>();
            List <InternalSceneData>     scenes   = collection.GetAllScenesAtBundle(collection.GetLastScene()?.BundleIdentifier, true);

            scenes.ForEach(scene => requests.Enqueue(new InternalSceneRequestUnload(scene)));

            return(requests);
        }