Ejemplo n.º 1
0
 public void ClearSlot()
 {
     BonusManager.Instance.ClearCurrentActivSlot();
     activCard.SetEnableImageCard(true);
     myCard.AnimatorDesable();
     ActivateBackImageCard(false);
     isFull  = false;
     myBonus = eSpecialCard.none;
     myCard.ClearFromCell();
 }
Ejemplo n.º 2
0
    public void ActivateBonus(BonusSlot _bonusSlot)
    {
        if (_bonusSlot == null || _bonusSlot.GetBonus() == eSpecialCard.none || activCard.myCard.Info.mySpecialCard != eSpecialCard.none || isNeedActivateBonus)
        {
            return;
        }
        eSpecialCard _currentBonus = _bonusSlot.GetBonus();

        SoundManager.Instance.PlayBonusStart(_currentBonus, true);
        isNeedActivateBonus = false;
        if (_currentBonus == eSpecialCard.Joker || _currentBonus.ToString().Contains("bullet"))
        {
            if (!activCard.GetIsMoving())
            {
                activCard.SetReserveCardToPoll();
                activCard.InitCard(0, 0, _currentBonus);
                _bonusSlot.ClearSlot();
            }
        }
        else if (_currentBonus.ToString().Contains("wind") || _currentBonus.ToString().Contains("fireworks"))
        {
            if (!activCard.GetIsMoving())
            {
                Transform card = _bonusSlot.GetMyCard().GetTransformImageCard();
                Vector3   pos  = activCard.transform.position;
                activCard.SetEnableImageCard(false);
                card.position = pos;
                NeedActivateBonus(_bonusSlot, false);
            }
        }
        else if (_currentBonus == eSpecialCard.upend1 || _currentBonus == eSpecialCard.upend2 || _currentBonus == eSpecialCard.upend3)
        {
            HexagonalCell[] closedCells = HexagonalGrid.Instance.GetAllClosedCard();
            for (int i = 0; i < closedCells.Length; i++)
            {
                closedCells[i].SetFlashingBack(true);
            }
            canUppend = (int)_currentBonus;
            NeedActivateBonus(_bonusSlot, true);
        }
        else if (_currentBonus == eSpecialCard.upend4)
        {
            HexagonalCell[] closedCells = HexagonalGrid.Instance.GetAllClosedCard();
            for (int i = 0; i < closedCells.Length; i++)
            {
                closedCells[i].GetCard().SetIsClosed(false);
            }
            _bonusSlot.ClearSlot();
        }
        else if (_currentBonus == eSpecialCard.hurricane)
        {
            HexagonalGrid.Instance.MixAllCards();
            _bonusSlot.ClearSlot();
        }
        else if (_currentBonus == eSpecialCard.free)
        {
            activCard.SetCanFlight();
            _bonusSlot.ClearSlot();
        }
        else
        {
            NeedActivateBonus(_bonusSlot, true);
        }
    }