parili
This commit is contained in:
@@ -4,7 +4,7 @@ using System.Collections.Generic;
|
||||
|
||||
[RequireComponent(typeof(NavMeshAgent))]
|
||||
[RequireComponent(typeof(Animator))]
|
||||
public class BossController : MonoBehaviour
|
||||
public class BossController : MonoBehaviour, IDamageble
|
||||
{
|
||||
[SerializeField] private float maxHp = 500f;
|
||||
[SerializeField] private float currentHp = 500f;
|
||||
@@ -15,13 +15,12 @@ public class BossController : MonoBehaviour
|
||||
[field: SerializeField] public float ChargeDuration { get; private set; } = 2f;
|
||||
[field: SerializeField] public float ChargeMinimumDistance { get; private set; } = 6f;
|
||||
[field: SerializeField] public float ChargeCooldownDuration { get; private set; } = 4f;
|
||||
[Tooltip("突進する前の、その場での咆哮・溜め時間(秒)")]
|
||||
[field: SerializeField] public float ChargeRoarDuration { get; private set; } = 5f; // ★インスペクターに逃がして保守性を向上
|
||||
[field: SerializeField] public float ChargeRoarDuration { get; private set; } = 5f;
|
||||
|
||||
[SerializeField] public Transform ceilingAnchor;
|
||||
[SerializeField] public Transform groundAnchor;
|
||||
[field: SerializeField] public float AttackRadius { get; private set; } = 10f;
|
||||
[field: SerializeField] public float JumpRoarDuration { get; private set; } = 2f;
|
||||
[field: SerializeField] public float JumpRoarDuration { get; private set; } = 5f;
|
||||
|
||||
[SerializeField] private GameObject warningMarkerPrefab;
|
||||
[SerializeField] private GameObject webPrefab;
|
||||
@@ -101,13 +100,13 @@ public class BossController : MonoBehaviour
|
||||
currentState.EnterState();
|
||||
}
|
||||
|
||||
public void TakeDamage(float damage)
|
||||
public void TakeDamage(DamageInfo damageInfo)
|
||||
{
|
||||
currentHp -= damage;
|
||||
currentHp -= damageInfo.amount;
|
||||
currentHp = Mathf.Clamp(currentHp, 0, maxHp);
|
||||
float hpPercentage = (currentHp / maxHp) * 100f;
|
||||
|
||||
Debug.Log($"💥 ボスに {damage} ダメージ。残りHP: {hpPercentage:F1}%");
|
||||
Debug.Log($"💥 ボスに { damageInfo.amount} ダメージ。残りHP: {hpPercentage:F1}%");
|
||||
|
||||
if (hpPercentage <= 25f && !triggered25)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user