Ejemplo n.º 1
0
        internal override SceneLoaderRequestResult Inspection(SceneCollection collection, bool forceNotSuppressible)
        {
            List <InternalSceneData> bundleScenes = collection.GetAllScenesAtBundle(_bundleIdentifier, _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 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);
        }