Ejemplo n.º 1
0
        public override void OnEnter()
        {
            var isPrevStateSwap = gameStateModel.State == Match3State.SwapInProgress;

            base.OnEnter();
            Debug.Log("Check matches -> " + gameStateModel.State);
            var matches = boardModel.FindMatches();

            //Found matches
            if (matches.Count > 0)
            {
                DestroyMatches(matches);
                if (isPrevStateSwap)
                {
                    playerScoreModel.Turns--;
                }

                coroutineProvider.StartCoroutine(WaitForDestruction());
                return;
            }

            //No matches found
            if (isPrevStateSwap)
            {
                //Start revert swap
                signalBus.Fire(new Match3Signals.StartSwapSignal(boardModel.FirstEntitySwapPosition,
                                                                 boardModel.SecondEntitySwapPosition, true));
            }
            else
            {
                signalBus.Fire(new Match3Signals.StateChartSignal(BoardStateEvents.NoMatchesFoundEvent));
            }
        }
Ejemplo n.º 2
0
        private void RequestAuthorization()
        {
            Log.Debug("Checking internet...");

            InternetReachabilityController.Check(reachable =>
            {
                Log.Debug(log =>
                {
                    log.Debug(reachable ? "Internet is reachable" : "Internet not reachable");
                    log.Debug("Requesting authorization...");
                });

                CoroutineProvider.StartCoroutine(RequestAuthorizationCoroutine(AuthorizationOptions, reachable), out _coroutine);
            });
        }
 public void OnEnter()
 {
     coroutineProvider.StartCoroutine(OnEnterCoroutine());
 }
Ejemplo n.º 4
0
 public void LoadAsset(string assetId)
 {
     //CoroutineProvider.Instance.StartCoroutine(LoadAssetAsync(assetId));
     _coroutineProvider.StartCoroutine(LoadAssetAsync(assetId));
 }
 public void Dispose()
 {
     coroutineProvider.StartCoroutine(DisposeWorld());
 }
Ejemplo n.º 6
0
 public void Initialize()
 {
     _coroutineProvider.StartCoroutine(StartGame());
     _gameModel.Activate();
 }
Ejemplo n.º 7
0
 public void StartGame()
 {
     _coroutineProvider.StartCoroutine(_gameStateMachine.GoToState("CoreGame"));
 }
Ejemplo n.º 8
0
    private void TriggerStateSwitch(GameSignals.GotoStateSignal gotoStateSignal)
    {
        var targetState = _gameStateFactory.Create(gotoStateSignal.TargetType);

        _coroutineProvider.StartCoroutine(GotoState(targetState));
    }