protected override void FixedUpdate() { GetAnimator.SetBool("IsGround", groundChecker.IsGround); GetAnimator.SetFloat("VelocityY", Rigid.velocity.y); base.FixedUpdate(); }
// Update is called once per frame protected override void Update() { if (!IsDead) { if (PlayerInSight() && currentState == BossStage.None) { ChangeCurrentStage(); } if (currentState == BossStage.Stage1) { //print("Stage1"); base.Update(); } if (currentState == BossStage.Stage2) { CanTakeDamage = false; NavMesh.speed = 15.0f; MoveEnemy(cocoon.transform.position); if (NavMesh.remainingDistance == 0) { NavMesh.Stop(); GetAnimator.SetTrigger("Cocoon"); EnableCocoon(); SpawnBroodlings(); } } if (currentState == BossStage.Stage3) { DisableCocoon(); NavMesh.Resume(); NavMesh.speed = 6.0f; CanTakeDamage = true; EnableAcidPools(); base.Update(); } if (CurrentHealth == (getMaxHealth() - getMaxHealth() / 3) && currentState == BossStage.Stage1) { ChangeCurrentStage(); } if (!brood1.activeSelf && !brood2.activeSelf && !brood3.activeSelf && currentState == BossStage.Stage2) { CurrentHealth = CurrentHealth - getMaxHealth() / 3; ChangeCurrentStage(); } } else { //Completion of level one indicated in character player.GetComponent <Character>().FinishedLevel(0); player.GetComponent <Character>().finishedLevel = true; } }
void Attack() { if (IsAttack == true) { return; } GetAnimator.SetTrigger("Attack"); }
private void FixedUpdate() { isGround = CheckGround(); GetAnimator.SetBool("IsGround", isGround); Move(horizontal); float vY = Rigid.velocity.y; GetAnimator.SetFloat("VelocityY", vY); }
public override void OnHurt(int amount) { GetAnimator.SetTrigger("Hurt"); base.OnHurt(amount); OffAttack(); if (Health <= 0) { Dead(); } }
void Move(float h) { GetAnimator.SetInteger("Run", (int)h); if (h == 0) { return; } transform.localScale = new Vector3(h * 15, 15, 1); transform.Translate(Vector3.right * h * RunSpeed * Time.fixedDeltaTime); }
void OnCollisionEnter(Collision col) { if (col.gameObject.CompareTag("Player")) { GetAnimator.SetTrigger("Attack"); } if (col.gameObject.CompareTag("Weapon") && canTakeDamage && !sheildOn && base.IsAlive) { print("BOSS HIT"); CurrentHealth -= 25.0f; StartCoroutine(damageDelay()); } }
private void RpcTurnAnimation(float value) { GetAnimator.SetFloat(_animatorTurn, value); }
private void RpcMoveAnimation(Vector3 direction) { GetAnimator.SetFloat(_animatorMoveForward, direction.z); GetAnimator.SetFloat(_animatorMoveRight, direction.x); }