示例#1
0
    public IEnumerator LaunchTurn(Sc_Player firstOpponent, Sc_Enemy secondOpponent)
    {
        canPlay = false;
        Sc_EventManager.instance.onUpdateStats.Invoke();
        Vector3 baseScale = fightText.transform.localScale;
        float   delay     = 2f;

        fightText.DOFade(1, 0.3f);
        fightText.transform.DOScale(baseScale * 1.5f, delay);
        yield return(new WaitForSeconds(delay));

        float wait = 3f;

        firstOpponent.StartAttack(secondOpponent);
        yield return(new WaitForSeconds(wait));

        if (!secondOpponent.isDead)
        {
            secondOpponent.StartAttack(firstOpponent);
            yield return(new WaitForSeconds(wait));
        }

        fightText.DOFade(0, delay - 0.3f);
        fightText.transform.DOScale(baseScale, 0).SetDelay(delay - 0.3f);
        yield return(new WaitForSeconds(delay - 0.3f));

        canPlay = true;
        firstOpponent.ResetStats();
        Sc_EventManager.instance.onUpdateStats.Invoke();
    }
示例#2
0
    private void Awake()
    {
        mainPlayer          = FindObjectOfType <Sc_Player>();
        currentEnemy        = FindObjectOfType <Sc_Enemy>();
        remainingActions    = maxActions;
        displayActions.text = remainingActions + "";
        fightText.DOFade(0, 0);

        screen = endScreen.GetComponentInChildren <Image>();
        txt    = endScreen.GetComponentInChildren <Text>();
        endScreen.GetComponentInChildren <Image>().DOFade(0, 0);
        endScreen.GetComponentInChildren <Text>().DOFade(0, 0);
    }