public override void EnterState(BaseAIMovementController owner) { _attackingState = new BasicMeleeAttackingState(); _returnToIdleState = new BasicMeleeReturnToIdleState(); GlobalState.state.AudioManager.BasicEnemyAlerted(owner.transform.position); base.EnterState(owner); }
public override void ExitState(BaseAIMovementController owner) { for (int i = 0; i < owner.meleeEnemy._healthBar.transform.childCount; i++) { owner.meleeEnemy._healthBar.transform.GetChild(i).gameObject.SetActive(false); } base.ExitState(owner); }
public override void EnterState(BaseAIMovementController owner) { base.EnterState(owner); _attackingState = new RangedEnemyAttackingState(); _returnToIdleState = new RangedEnemyReturnToIdleState(); GlobalState.state.AudioManager.RangedEnemyAlertAudio(owner.rangedAI.transform.position); }
public override void UpdateState(BaseAIMovementController owner) { owner._attackRateTimer += Time.deltaTime; //float range = owner._attackRange - owner._agent.stoppingDistance; float range = owner._attackRange; owner.FacePlayer(); if (range < Vector3.Distance(owner._target.transform.position, owner.transform.position)) { owner.stateMachine.ChangeState(_chasingState); } else if (range > Vector3.Distance(owner._target.transform.position, owner.transform.position)) { if (owner._attackRateTimer.Expired) { owner.stateMachine.ChangeState(new BasicMeleeSwingState()); } } }
public override void UpdateState(BaseAIMovementController owner) { if (owner._attackRange < Vector3.Distance(owner._target.transform.position, owner.transform.position)) { owner.stateMachine.ChangeState(_chasingState); } else if (Vector3.Distance(owner._target.transform.position, owner.transform.position) < owner.rangedAI._meleeRange) { if (owner._attackRateTimer.Expired) { owner.stateMachine.ChangeState(new RangedEnemySwingState()); } } owner._attackRateTimer += Time.deltaTime; owner.rangedAI.FacePlayer(); if (owner._attackRateTimer.Expired && Vector3.Distance(owner._target.transform.position, owner.transform.position) > owner.rangedAI._meleeRange) { owner.stateMachine.ChangeState(new RangedEnemyFiringState()); } }
public override void EnterState(BaseAIMovementController owner) { _chasingState = new ShadowEnemyChasingState(); _idleState = new ShadowEnemyIdleState(); }
public override void EnterState(BaseAIMovementController owner) { _attackingState = new ShadowEnemyAttackingState(); _returnToIdleState = new ShadowEnemyReturnToIdleState(); }
public override void UpdateState(BaseAIMovementController owner) { base.UpdateState(owner); owner._attackRateTimer += Time.deltaTime; }
public override void EnterState(BaseAIMovementController owner) { _chasingState = new BasicMeleeChasingState(); _idleState = new BasicMeleeIdleState(); base.EnterState(owner); }
public override void UpdateState(BaseAIMovementController owner) { base.UpdateState(owner); }
public override void EnterState(BaseAIMovementController owner) { _chasingState = new RangedEnemyChasingState(); _idleState = new RangedEnemyIdleState(); base.EnterState(owner); }
public override void EnterState(BaseAIMovementController owner) { owner.GenerateNewAttackTimer(); _chasingState = new RangedEnemyChasingState(); base.EnterState(owner); }