Esempio n. 1
0
    IEnumerator FlipTopCard()
    {
        currentCard = playerCards.Peek().GetComponent <CharacterCardScript>();

        currentCard.portrait.material.SetColor("_DestColor", playerColor);
        currentCard.ToggleAttackIcons(false);

        Vector3    startPos  = currentCard.transform.position;
        Quaternion startRot  = currentCard.transform.rotation;
        float      startTime = Time.time;

        while (Time.time < startTime + cardFlipDuration)
        {
            float step = Mathf.SmoothStep(0, 1, (Time.time - startTime) / cardFlipDuration);
            currentCard.transform.position = Vector3.Lerp(startPos, cardPlaceholder.position, step);
            currentCard.transform.rotation = Quaternion.Lerp(startRot, cardPlaceholder.rotation, step);
            yield return(null);
        }

        playerSprite.sprite  = currentCard.character.portrait;
        playerSprite.enabled = true;
        waitingForAttack     = true;
        selectedAttack       = null;
        readyText.SetActive(false);
        finalDamage = null;
    }
Esempio n. 2
0
 public void FeedChar(CharacterCardScript Char)
 {
     Char.MainAttack = MealMainAbility;
     Char.secondBuff = MealSecondAbility;
     Char.thirdBuff  = MealThirdAbility;
     EventSystem.current.SetSelectedGameObject(null);
     ResetUI();
 }