Exemplo n.º 1
0
    // OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
    //override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
    //{
    //
    //}

    // OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks
    public override void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
    {
        switch (anim.GetInteger("Stage"))
        {
        case 40:
            combat.StartCoroutine(TeleportToTalk("FirstDialogue", combat.tpPoints[4]));
            anim.SetInteger("Stage", 0);
            break;

        case 30:
            combat.StartCoroutine(TeleportToTalk("SecondDialogue", combat.tpPoints[3]));
            anim.SetInteger("Stage", 0);
            break;

        case 20:
            combat.StartCoroutine(TeleportToTalk("SecondDialogue", combat.tpPoints[2]));
            anim.SetInteger("Stage", 0);
            break;

        case 10:
            combat.StartCoroutine(TeleportToTalk("ThirdDialogue", combat.tpPoints[0]));
            anim.SetInteger("Stage", 0);
            combat.isInvincible = false;
            break;
        }

        if (anim.GetInteger("Stage") == 0 && SaveManager.checkPoint == 3 && !DialogManager.instance.isInDialogue)
        {
            anim.SetInteger("Stage", 1);
        }

        if (anim.GetInteger("Stage") == 1)
        {
            combat.isInvincible = false;
            anim.SetBool("IsCast", true);
        }

        if (anim.GetInteger("Stage") == 2 && !DialogManager.instance.isInDialogue)
        {
            dialogue.TriggerDialogue("WolfPower");
            anim.SetBool("IsWolfed", true);
        }

        if (anim.GetInteger("Stage") == 3 && !DialogManager.instance.isInDialogue)
        {
            anim.SetBool("IsCast", true);
        }

        if (anim.GetInteger("Stage") == 4 && !DialogManager.instance.isInDialogue)
        {
            dialogue.TriggerDialogue("WolfPower2");
            anim.SetBool("IsWolfed", true);
        }

        if (anim.GetInteger("Stage") == 5 && !DialogManager.instance.isInDialogue)
        {
            anim.SetBool("IsCast", true);
        }
    }
Exemplo n.º 2
0
    private IEnumerator FirstPattern()
    {
        combat.StartCoroutine(MakeWave(7, 8, waveDuration));
        yield return(new WaitForSeconds(waveDuration));

        combat.StartCoroutine(MakeWave(1, 5, waveDuration));
        yield return(new WaitForSeconds(waveDuration));

        combat.StartCoroutine(MakeWave(0, 2, waveDuration));
        yield return(new WaitForSeconds(waveDuration));

        combat.StartCoroutine(MakeWave(3, 4, waveDuration));
        yield return(new WaitForSeconds(waveDuration + 2));

        dialogue.TriggerDialogue("AfterFirst");
        anim.SetBool("IsCast", false);
        anim.SetInteger("Stage", 2);
    }
Exemplo n.º 3
0
    private IEnumerator TpToBalcony(Transform to, string dialogueName)
    {
        dialogue.TriggerDialogue(dialogueName);
        while (DialogManager.instance.isInDialogue)
        {
            yield return(null);
        }

        combat.transform.parent.position = to.position;
        yield return(null);
    }