47 lines
1.4 KiB
C#
47 lines
1.4 KiB
C#
using UnityEngine;
|
|
|
|
using Colosseum.Player;
|
|
|
|
namespace Colosseum.Skills.Effects
|
|
{
|
|
/// <summary>
|
|
/// 대상에게 다운 상태를 적용하는 스킬 효과입니다.
|
|
/// </summary>
|
|
[CreateAssetMenu(fileName = "DownEffect", menuName = "Colosseum/Skills/Effects/Down")]
|
|
public class DownEffect : SkillEffect
|
|
{
|
|
[Header("Settings")]
|
|
[Tooltip("다운 지속 시간")]
|
|
[Min(0f)] [SerializeField] private float duration = 1f;
|
|
|
|
/// <summary>
|
|
/// 다운 지속 시간
|
|
/// </summary>
|
|
public float Duration => duration;
|
|
|
|
/// <summary>
|
|
/// 다운 효과를 적용합니다.
|
|
/// </summary>
|
|
protected override void ApplyEffect(GameObject source, GameObject target)
|
|
{
|
|
if (target == null)
|
|
{
|
|
Debug.LogWarning("[DownEffect] Target is null.");
|
|
return;
|
|
}
|
|
|
|
HitReactionController hitReactionController = target.GetComponent<HitReactionController>();
|
|
if (hitReactionController == null)
|
|
hitReactionController = target.GetComponentInParent<HitReactionController>();
|
|
|
|
if (hitReactionController == null)
|
|
{
|
|
Debug.LogWarning($"[DownEffect] HitReactionController not found on target: {target.name}");
|
|
return;
|
|
}
|
|
|
|
hitReactionController.ApplyDown(duration);
|
|
}
|
|
}
|
|
}
|