Ejemplo n.º 1
0
        public MenuPage(UIManager uiManager,
                        LoadObjectsManager loadObjectsManager,
                        ScenesManager scenesManager,
                        GameStateManager gameStateManager,
                        PlayerDataManager dataManager,
                        SoundSystem soundSystem)
        {
            _uiManager          = uiManager;
            _loadObjectsManager = loadObjectsManager;
            _scenesManager      = scenesManager;
            _gameStateManager   = gameStateManager;
            _dataManager        = dataManager;
            _soundSystem        = soundSystem;

            _uiManager.AddPage(this);

            _awaiter = _loadObjectsManager.GetObjectByPath(Constants.PATH_TO_UI_PREFABS + "MenuPage").GetAwaiter();



            _awaiter.OnCompleted(() => {
                SelfPage = MonoBehaviour.Instantiate(_awaiter.GetResult() as GameObject);
                SelfPage.transform.SetParent(_uiManager.Canvas.transform, false);
                _pageComponent = SelfPage.GetComponent <MenuPageComponent>();
            });
        }
Ejemplo n.º 2
0
        protected void SourceMoveNext()
        {
CONTINUE:
            sourceMoveNext = enumerator.MoveNextAsync().GetAwaiter();
            if (sourceMoveNext.IsCompleted)
            {
                bool result = false;
                try
                {
                    if (!TryMoveNextCore(sourceMoveNext.GetResult(), out result))
                    {
                        goto CONTINUE;
                    }
                }
                catch (Exception ex)
                {
                    completionSource.TrySetException(ex);
                    return;
                }

                if (cancellationToken.IsCancellationRequested)
                {
                    completionSource.TrySetCanceled(cancellationToken);
                }
                else
                {
                    completionSource.TrySetResult(result);
                }
            }
            else
            {
                sourceMoveNext.SourceOnCompleted(moveNextCallbackDelegate, this);
            }
        }
Ejemplo n.º 3
0
 bool TryGetResultWithNotification <T>(UniTask <T> .Awaiter awaiter, out T result)
 {
     try {
         result = awaiter.GetResult();
         return(true);
     }
     catch (Exception ex) {
         CallTrySetExceptionAfterNotification(ex);
         result = default;
         return(false);
     }
 }
Ejemplo n.º 4
0
 protected bool TryGetResult <T>(UniTask <T> .Awaiter awaiter, out T result)
 {
     try
     {
         result = awaiter.GetResult();
         return(true);
     }
     catch (Exception ex)
     {
         completionSource.TrySetException(ex);
         result = default;
         return(false);
     }
 }
Ejemplo n.º 5
0
        public SettingsPopup(UIManager uIManager,
                             LoadObjectsManager loadObjectsManager,
                             GameStateManager gameStateManager)
        {
            _uIManager          = uIManager;
            _loadObjectsManager = loadObjectsManager;
            _gameStateManager   = gameStateManager;
            _uIManager.AddPopup(this);

            _awaiter = _loadObjectsManager.GetObjectByPath(Constants.PATH_TO_UI_PREFABS + "Popups/SettingsPopup").GetAwaiter();

            _awaiter.OnCompleted(() => {
                SelfPage = MonoBehaviour.Instantiate(_awaiter.GetResult() as GameObject);
                SelfPage.transform.SetParent(_uIManager.Canvas.transform, false);
                _pageComponent = SelfPage.GetComponent <SettingsPopupComponent>();
                OnPopupWasInited();
            });
        }
Ejemplo n.º 6
0
            protected override bool OnFirstIteration()
            {
                if (set != null)
                {
                    return(false);
                }

                awaiter = second.ToHashSetAsync(cancellationToken).GetAwaiter();
                if (awaiter.IsCompleted)
                {
                    set = awaiter.GetResult();
                    SourceMoveNext();
                }
                else
                {
                    awaiter.SourceOnCompleted(HashSetAsyncCoreDelegate, this);
                }

                return(true);
            }
Ejemplo n.º 7
0
 public void GetResult()
 {
     Create();
     value.GetResult();
 }