불필요한 Debug.Log 및 Debug.LogWarning 호출 제거로 프로덕션 로그 정리 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
31 lines
1009 B
C#
31 lines
1009 B
C#
using UnityEngine;
|
|
|
|
namespace Colosseum.Skills.Effects
|
|
{
|
|
/// <summary>
|
|
/// 넉백 효과
|
|
/// </summary>
|
|
[CreateAssetMenu(fileName = "KnockbackEffect", menuName = "Colosseum/Skills/Effects/Knockback")]
|
|
public class KnockbackEffect : SkillEffect
|
|
{
|
|
[Header("Knockback Settings")]
|
|
[Min(0f)] [SerializeField] private float force = 5f;
|
|
[SerializeField] private float upwardForce = 2f;
|
|
|
|
protected override void ApplyEffect(GameObject caster, GameObject target)
|
|
{
|
|
if (target == null || caster == null) return;
|
|
|
|
Vector3 direction = target.transform.position - caster.transform.position;
|
|
direction.y = 0f;
|
|
direction.Normalize();
|
|
|
|
Vector3 knockback = direction * force + Vector3.up * upwardForce;
|
|
|
|
// TODO: 실제 물리 시스템 연동
|
|
// if (target.TryGetComponent<Rigidbody>(out var rb))
|
|
// rb.AddForce(knockback, ForceMode.Impulse);
|
|
}
|
|
}
|
|
}
|