private void PrepareFading(bool fadeIn, int level, bool isLastSibling = true) { _timerManager.StopTimer(Fade); _fadeImageGroups[level].alpha = fadeIn ? 0f : _fadeGoalValue; if (isLastSibling) { _fadeImageGroups[level].transform.SetAsLastSibling(); } _fadeImageGroups[level].gameObject.SetActive(true); IsFading = true; }
public void StopTimer(ITimer timer, bool isComplete) { _timerManager.StopTimer(timer, isComplete); }
public void ResetAll() { StopHandTimer(); _timerManager.StopTimer(SetStatusZoomingFalse); }
public void EndCardDistribution() { if (!CardDistribution) { return; } _gameplayManager.IsPreparingEnded = true; GameClient.Get <ICameraManager>().FadeOut(immediately: true); _timerManager.StopTimer(DirectlyEndCardDistribution); // for local player List <BoardCard> cards = new List <BoardCard>(); cards.AddRange(_gameplayManager.CurrentPlayer.CardsPreparingToHand.FindAll(x => x.CardShouldBeChanged)); foreach (BoardCard card in cards) { _gameplayManager.CurrentPlayer.CardsInDeck.Remove(card.WorkingCard); _gameplayManager.CurrentPlayer.CardsInDeck.Add(card.WorkingCard); card.ReturnCardToDeck(); } foreach (BoardCard card in _gameplayManager.CurrentPlayer.CardsPreparingToHand) { SortingGroup sortingGroup = card.GameObject.GetComponent <SortingGroup>(); sortingGroup.sortingLayerName = "Foreground"; sortingGroup.sortingOrder = 1; _gameplayManager.CurrentPlayer.RemoveCardFromDeck(card.WorkingCard); _gameplayManager.CurrentPlayer.CardsInHand.Add(card.WorkingCard); _battlegroundController.PlayerHandCards.Add(card); _timerManager.AddTimer( x => { card.HandBoardCard.Enabled = true; }, null, 2f); } if (_gameplayManager.CurrentPlayer.CardsPreparingToHand.Count > 0) { _battlegroundController.UpdatePositionOfCardsInPlayerHand(true); _gameplayManager.CurrentPlayer.CardsPreparingToHand.Clear(); } CardDistribution = false; _gameplayManager.CurrentPlayer.ThrowOnHandChanged(); if (!_gameplayManager.IsTutorial) { _gameplayManager.CurrentPlayer.CardsInDeck = _gameplayManager.CurrentPlayer.ShuffleCardsList(_gameplayManager.CurrentPlayer.CardsInDeck); _battlegroundController.StartGameplayTurns(); } else { _battlegroundController.StartGameplayTurns(); } }