//Hay tres estados que son imperativos, a los cuales se debe poder acceder desde cualquier estado.
    //Estos son, Invocar cada X Segundos.
    //
    void Update()
    {
        timer -= Time.deltaTime;
        if (Vector3.Distance(transform.position, target.transform.position) < 10f)
        {
            isNear = true;
        }
        else
        {
            isNear = false;
        }

        if (timer <0 && !dying && !drinking && isNear)
        {
            timer = invokeTime;
            bStateMachineC.EnableState(bStateMachineC.BInvokeC);
        }

        if (health <=40 && canDrink && isNear)
        {
            canDrink = false;
            bStateMachineC.EnableState(bStateMachineC.BDrinkC);
        }
        if (health <=10 && !dying && isNear)
        {
            health = 5;
            dying = true;
            bStateMachineC.EnableState(bStateMachineC.BDieC);
        }
    }
 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);
     }
 }
示例#3
0
 void CheckDistance()
 {
     if (Vector3.Distance(transform.position, bManager.target.transform.position) >= 3f && enableMove)
     {
         bStateMachineC.EnableState(bStateMachineC.BFollowC);
     }
 }
示例#4
0
 private void Update()
 {
     bNavMeshC.Destination(bManager.spawnPosition);
     bManager.bossBar.SetActive(false);
     if (bNavMeshC.agent.velocity.magnitude > 0.5f)
     {
         bManager.anim.SetBool("Walking", true);
     }
     else
     {
         bManager.anim.SetBool("Walking", false);
     }
     if (Vector3.Distance(transform.position, bManager.spawnPosition) < 2f)
     {
         bManager.anim.SetBool("Walking", false);
         AudioManager.am.MazzSong();
         bStateMachineC.EnableState(bStateMachineC.BIdleC);
     }
 }
 void CheckDistance()
 {
     if (Vector3.Distance(transform.position, bManager.target.transform.position) < 15f)
     {
         bManager.idleLookPos.transform.GetChild(0).gameObject.SetActive(true);
         AudioManager.am.BossSong();
         bStateMachineC.EnableState(bStateMachineC.BFollowC);
     }
     else
     {
         transform.LookAt(bManager.idleLookPos.transform.position);
         bManager.idleLookPos.transform.GetChild(0).gameObject.SetActive(false);
         //Si esta tranquilo, se reestablece.
         bManager.health = bManager.maxHealth;
         bManager.HealthBar();
         bManager.canDrink             = true;
         bManager.drinking             = false;
         bManager.skin.material.color  = Color.white;
         bManager.mouth.material.color = Color.white;
         bManager.attackType           = "Attack";
         bManager.agent.speed          = 3.5f;
     }
 }
示例#6
0
 void ChangeToFollow()
 {
     bManager.drinking = false;
     bStateMachineC.EnableState(bStateMachineC.BFollowC);
 }
 void ChangeToFollow()
 {
     invoking = false;
     bStateMachineC.EnableState(bStateMachineC.BFollowC);
 }