Ejemplo n.º 1
0
        private void SyncNext()
        {
            if (_scenesToSync.Count == 0)
            {
                _syncingAttribute = null;
                Resources.UnloadUnusedAssets();
                DispatchSceneLoadedSignal();
                return;
            }

            _syncingAttribute = _scenesToSync.Dequeue();
            if ((_syncingAttribute.Relationship & SceneRelationshipType.Exclude) != 0)
            {
                UnloadSceneSignal.Dispatch(_syncingAttribute.SceneType);
                SyncNext();
            }
            else if ((_syncingAttribute.Relationship & SceneRelationshipType.Include) != 0)
            {
                LoadSceneSignal.Dispatch(_syncingAttribute.SceneType);
            }
            else
            {
                SyncNext();
            }
        }
Ejemplo n.º 2
0
 protected override void MapBindings()
 {
     Rapid.Bind <LoadSceneSignal>();
     Rapid.Bind <UnloadSceneSignal>();
     Rapid.Bind <SceneLoadedSignal>();
     Rapid.Bind <SceneUnloadedSignal>();
     LoadSceneSignal.AddCommand <LoadSceneCommand>();
     UnloadSceneSignal.AddCommand <UnloadSceneCommand>();
 }
Ejemplo n.º 3
0
 protected override void UnmapBindings()
 {
     LoadSceneSignal.RemoveCommand <LoadSceneCommand>();
     UnloadSceneSignal.RemoveCommand <UnloadSceneCommand>();
     Rapid.Unbind <LoadSceneSignal>();
     Rapid.Unbind <UnloadSceneSignal>();
     Rapid.Unbind <SceneLoadedSignal>();
     Rapid.Unbind <SceneUnloadedSignal>();
 }
Ejemplo n.º 4
0
 public void Execute(UnloadSceneSignal loadParams)
 {
     _sceneLoader.UnloadScene(loadParams.Scene).Done(
         () =>
     {
         loadParams.OnComplete?.Resolve();
     },
         exception =>
     {
         loadParams.OnComplete?.Reject(exception);
     }
         );
 }
Ejemplo n.º 5
0
        protected override void OnDestroy()
        {
            var atts = GetType().GetAttributes <SceneRelationshipAttribute>(false);

            foreach (var att in atts)
            {
                if ((att.Relationship & SceneRelationshipType.Depend) != 0)
                {
                    UnloadSceneSignal.Dispatch(att.SceneType);
                }
            }
            UnmapBindings();
            Resources.UnloadUnusedAssets();
            SceneUnloadedSignal.Dispatch(GetType());
            base.OnDestroy();
        }
Ejemplo n.º 6
0
 private void OnBackButtonClicked()
 {
     UnloadSceneSignal.Unload(SignalBus, Scenes.GamePlay)
     .Done((() => _bootstrapModel.LoadingProgress.Value = BootstrapModel.ELoadingProgress.MainHub));
 }