void CheckDistance()
 {
     if (Vector3.Distance(transform.position, bManager.target.transform.position) <= 1.15f + 1f)
     {
         bManager.anim.SetBool("Walking", false);
         bNavMeshC.Stop();
         bStateMachineC.EnableState(bStateMachineC.BAttackC);
     }
     if (Vector3.Distance(transform.position, bManager.target.transform.position) > 15f)
     {
         bManager.anim.SetBool("Walking", false);
         bNavMeshC.Stop();
         bStateMachineC.EnableState(bStateMachineC.BReturnC);
     }
 }
    void Update()
    {
        bNavMeshC.Stop();
        Invoke("LookPlayer", 2.52f);
        if (die)
        {
            Die(die);
        }


        if (bManager.health <= 0)
        {
            SceneManager.LoadScene(3);
        }
    }
Esempio n. 3
0
    private void Update()
    {
        bNavMeshC.Stop();
        transform.LookAt(bManager.targetTest.transform.position);
        if (!bManager.drinking)
        {
            bManager.audioDrink.Play();
            bManager.Inmortality();
            bManager.drinking = true;
            bManager.anim.SetTrigger("Heal");

            Invoke("BerserkerChanges", 5.1f);
            Invoke("CancelShield", 8.2f);
            Invoke("ChangeToFollow", 8.3f);
        }
    }
    private void Update()
    {
        bNavMeshC.Stop();
        if (!invoking)
        {
            invoking = true;
            bManager.audioChicken.Play();
            bManager.anim.SetTrigger("Invoke");
            bManager.Inmortality();
            //Invocacion
            Instantiate(bManager.chicken, bManager.invokePos1.position, transform.rotation);
            Instantiate(bManager.chicken, bManager.invokePos2.position, transform.rotation);


            Invoke("Mortality", 1.9f);
            Invoke("ChangeToFollow", 2f);
        }
    }
Esempio n. 5
0
 private void Update()
 {
     bNavMeshC.Stop();
     Attack();
     CheckDistance();
 }