//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); } }
void CheckDistance() { if (Vector3.Distance(transform.position, bManager.target.transform.position) >= 3f && enableMove) { bStateMachineC.EnableState(bStateMachineC.BFollowC); } }
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; } }
void ChangeToFollow() { bManager.drinking = false; bStateMachineC.EnableState(bStateMachineC.BFollowC); }
void ChangeToFollow() { invoking = false; bStateMachineC.EnableState(bStateMachineC.BFollowC); }