private void PounceChargingState() { m_pounceComplete = false; if (m_timeInState == 0.0f) { m_pounceDestination = m_movement.PlayerPosition() + m_movement.DirectionToPlayer() * m_pounceOvershoot; m_audio.TriggerPounceCharge(); } if (m_timeInState > m_pounceChargeTime / m_stage) { ChangeState(BossState.Pouncing); } }
void Attack() { m_enemyAudio.TriggerEnemyAttack(); if (m_aimAtPlayer) { Vector2 aimPosition = m_movement.PlayerPosition(); Vector2 aimDirection = aimPosition - new Vector2(transform.position.x, transform.position.y); aimDirection += MathsHelper.RandomWithNegativeVector2() * m_inaccuracy; FireBullet(aimDirection); } else { foreach (var aimDirection in m_firingDirections) { FireBullet(aimDirection); } } }