もろもろ
Warningprefabを追加 Hpゲージの選定 ボスの攻撃判定を改善
This commit is contained in:
@@ -51,26 +51,47 @@ public class SpiderChaseState : SpiderStateBase
|
||||
public class SpiderBiteState : SpiderStateBase
|
||||
{
|
||||
private float stateTimer;
|
||||
private const float TurnSpeed = 4f;
|
||||
|
||||
public SpiderBiteState(BossController owner) : base(owner) { }
|
||||
|
||||
public override void EnterState()
|
||||
{
|
||||
stateTimer = 1.5f;
|
||||
|
||||
boss.Agent.ResetPath();
|
||||
boss.Agent.isStopped = true;
|
||||
boss.Agent.velocity = Vector3.zero;
|
||||
boss.Agent.ResetPath();
|
||||
boss.Agent.isStopped = true;
|
||||
boss.Agent.velocity = Vector3.zero;
|
||||
|
||||
boss.Anim.SetFloat("Speed", 0f);
|
||||
|
||||
boss.Anim.SetTrigger("Attack_Bite");
|
||||
Debug.Log("🎯 蜘蛛ボス:噛みつき攻撃! その場に完全固定。");
|
||||
Debug.Log("🎯 蜘蛛ボス:通常噛みつき開始。攻撃モーション中にゆっくり向き直ります。");
|
||||
}
|
||||
|
||||
public override void ExitState()
|
||||
{
|
||||
boss.Agent.isStopped = false;
|
||||
}
|
||||
|
||||
public override void UpdateState()
|
||||
{
|
||||
boss.Agent.velocity = Vector3.zero;
|
||||
|
||||
if (boss.Player != null)
|
||||
{
|
||||
Vector3 lookDir = (boss.Player.position - boss.transform.position).normalized;
|
||||
lookDir.y = 0;
|
||||
|
||||
if (lookDir != Vector3.zero)
|
||||
{
|
||||
boss.transform.rotation = Quaternion.Slerp(
|
||||
boss.transform.rotation,
|
||||
Quaternion.LookRotation(lookDir),
|
||||
Time.deltaTime * TurnSpeed
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
stateTimer -= Time.deltaTime;
|
||||
if (stateTimer <= 0f)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user