もろもろ

Warningprefabを追加
Hpゲージの選定
ボスの攻撃判定を改善
This commit is contained in:
oogushiyuuga
2026-07-17 12:29:03 +09:00
parent 49946b6240
commit ae74d4b279
26 changed files with 2026 additions and 28 deletions

View File

@@ -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)
{