Exemplo n.º 1
0
        //=============================================================================//
        //============ Internal Methods
        //=============================================================================//
        #region Internal Methods
        internal override SceneLoaderRequestResult Inspection(SceneCollection collection)
        {
            SceneLoaderRequestResult resultSceneInspection = ScenesExistsInspection(collection);

            if (resultSceneInspection.IsSuccess == false)
            {
                return(resultSceneInspection);
            }

            SceneLoaderRequestResult resultBundleInspection = BundleExistsInspection(collection);

            if (resultBundleInspection.IsSuccess == false)
            {
                return(resultBundleInspection);
            }

            SceneLoaderRequestResult resultAdditionalInspection = AdditionalInspection(collection);

            if (resultAdditionalInspection.IsSuccess == false)
            {
                return(resultAdditionalInspection);
            }

            return(SceneLoaderConstants.REQUEST_RESULTS[SceneLoaderReturnType.Accepted]);
        }
Exemplo n.º 2
0
        private void Update()
        {
            if (_processLoaderFinish && _isFading == false)
            {
                _processLoaderFinish = false;
                if (_fader != null)
                {
                    _isFading = true;
                    _fader.OnFadeInCompleted += FadeInCompletedProcessFinish;
                    _fader.FadeIn();
                }
            }

            if (_currentRequest == null && _requests.Count > 0 && _sceneLoader.IsBusy == false)
            {
                _currentRequest = _requests.Dequeue();
                SceneLoaderRequestResult inspectionResult = _currentRequest.Inspection(_sceneLoader.Collection);
                _currentRequest.Callback?.Invoke(inspectionResult.IsSuccess);
                if (inspectionResult.IsSuccess)
                {
                    Queue <InternalSceneRequest> requests = _currentRequest.BuildRequests(_sceneLoader.Collection);
                    if (requests != null && requests.Count > 0)
                    {
                        if (_fader != null)
                        {
                            _builtRequestsForLoader = requests;
                            _isFading = true;
                            _fader.OnFadeInCompleted += FadeInCompletedProcessStart;
                            _fader.FadeIn();
                        }
                        else
                        {
                            _sceneLoader.SendRequest(requests);
                        }
                    }
                }

                _currentRequest = null;
            }
        }