- 이상 상태 데이터 (버프/디버프) ScriptableObject 정의 - 런타임임 활성 이상 상태 관리 (ActiveAbnormality) - 캐릭터터별 AbnormalityManager 컴포넌트로 이상 상태 적용/제거 - 스킬 효과(AbnormalityEffect)로 스킬에 이상 상태 연동 - UI 슬롯 및 목록 표시 구현 (버프/디버프 구분) - 테스트 코드 및 씬 설정 추가 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
47 lines
1.6 KiB
C#
47 lines
1.6 KiB
C#
using UnityEngine;
|
|
using Colosseum.Abnormalities;
|
|
|
|
namespace Colosseum.Skills.Effects
|
|
{
|
|
/// <summary>
|
|
/// 이상 상태 효과
|
|
/// AbnormalityManager를 통해 대상에게 이상 상태를 적용합니다.
|
|
/// </summary>
|
|
[CreateAssetMenu(fileName = "AbnormalityEffect", menuName = "Colosseum/Skills/Effects/Abnormality")]
|
|
public class AbnormalityEffect : SkillEffect
|
|
{
|
|
[Header("Abnormality")]
|
|
[Tooltip("적용할 이상 상태 데이터")]
|
|
[SerializeField] private AbnormalityData abnormalityData;
|
|
|
|
protected override void ApplyEffect(GameObject caster, GameObject target)
|
|
{
|
|
if (target == null) return;
|
|
|
|
if (abnormalityData == null)
|
|
{
|
|
Debug.LogWarning($"[AbnormalityEffect] AbnormalityData is not assigned");
|
|
return;
|
|
}
|
|
|
|
var abnormalityManager = target.GetComponent<AbnormalityManager>();
|
|
if (abnormalityManager == null)
|
|
{
|
|
Debug.LogWarning($"[AbnormalityEffect] Target {target.name} has no AbnormalityManager");
|
|
return;
|
|
}
|
|
|
|
abnormalityManager.ApplyAbnormality(abnormalityData, caster);
|
|
Debug.Log($"[AbnormalityEffect] Applied {abnormalityData.abnormalityName} to {target.name} from {caster?.name ?? "unknown"}");
|
|
}
|
|
|
|
/// <summary>
|
|
/// 이상 상태 데이터 설정 (런타임용)
|
|
/// </summary>
|
|
public void SetAbnormalityData(AbnormalityData data)
|
|
{
|
|
abnormalityData = data;
|
|
}
|
|
}
|
|
}
|