2026-04-09 스킬시스템 수정사항
This commit is contained in:
@@ -55,7 +55,8 @@ public class SkillData : ScriptableObject
|
|||||||
public string AnimTrigger;
|
public string AnimTrigger;
|
||||||
|
|
||||||
[Header("이펙트")]
|
[Header("이펙트")]
|
||||||
public GameObject EffectPrefab;
|
public GameObject AttackEffectPrefab;
|
||||||
|
public GameObject CastEffectPrefab;
|
||||||
|
|
||||||
[Header("범위 지정 (Remote용)")]
|
[Header("범위 지정 (Remote용)")]
|
||||||
public GameObject AreaIndicatorPrefab;
|
public GameObject AreaIndicatorPrefab;
|
||||||
|
|||||||
@@ -18,9 +18,9 @@ private void ApplyArea(SkillInstance skill, Transform caster, Vector3 center, fl
|
|||||||
SkillLevelData levelData = skill.CurrentLevelData;
|
SkillLevelData levelData = skill.CurrentLevelData;
|
||||||
int damage = Mathf.RoundToInt(levelData.Damage * chargeRatio);
|
int damage = Mathf.RoundToInt(levelData.Damage * chargeRatio);
|
||||||
|
|
||||||
if (skill.Data.EffectPrefab != null)
|
if (skill.Data.AttackEffectPrefab != null)
|
||||||
{
|
{
|
||||||
Instantiate(skill.Data.EffectPrefab, center, Quaternion.identity);
|
Instantiate(skill.Data.AttackEffectPrefab, center, Quaternion.identity);
|
||||||
}
|
}
|
||||||
|
|
||||||
Collider[] hits = Physics.OverlapSphere(center, levelData.Range);
|
Collider[] hits = Physics.OverlapSphere(center, levelData.Range);
|
||||||
|
|||||||
@@ -4,10 +4,10 @@ public class ProjectileEffect : MonoBehaviour, ISkillEffect
|
|||||||
{
|
{
|
||||||
public void Execute(SkillInstance skill, Transform caster, float chargeRatio)
|
public void Execute(SkillInstance skill, Transform caster, float chargeRatio)
|
||||||
{
|
{
|
||||||
if (skill.Data.EffectPrefab == null) return;
|
if (skill.Data.AttackEffectPrefab == null) return;
|
||||||
|
|
||||||
Vector3 spawnPos = caster.position + caster.forward + Vector3.up;
|
Vector3 spawnPos = caster.position + caster.forward + Vector3.up;
|
||||||
GameObject proj = Instantiate(skill.Data.EffectPrefab, spawnPos, caster.rotation);
|
GameObject proj = Instantiate(skill.Data.AttackEffectPrefab, spawnPos, caster.rotation);
|
||||||
|
|
||||||
// 투사체에 데미지 정보 전달
|
// 투사체에 데미지 정보 전달
|
||||||
// proj.GetComponent<Projectile>()?.Init(skill.CurrentLevelData.Damage * chargeRatio);
|
// proj.GetComponent<Projectile>()?.Init(skill.CurrentLevelData.Damage * chargeRatio);
|
||||||
@@ -15,12 +15,12 @@ public void Execute(SkillInstance skill, Transform caster, float chargeRatio)
|
|||||||
|
|
||||||
public void ExecuteAtPosition(SkillInstance skill, Transform caster, Vector3 targetPos, float chargeRatio)
|
public void ExecuteAtPosition(SkillInstance skill, Transform caster, Vector3 targetPos, float chargeRatio)
|
||||||
{
|
{
|
||||||
if (skill.Data.EffectPrefab == null) return;
|
if (skill.Data.AttackEffectPrefab == null) return;
|
||||||
|
|
||||||
Vector3 spawnPos = caster.position + Vector3.up;
|
Vector3 spawnPos = caster.position + Vector3.up;
|
||||||
Vector3 direction = (targetPos - spawnPos).normalized;
|
Vector3 direction = (targetPos - spawnPos).normalized;
|
||||||
Quaternion rotation = Quaternion.LookRotation(direction);
|
Quaternion rotation = Quaternion.LookRotation(direction);
|
||||||
GameObject proj = Instantiate(skill.Data.EffectPrefab, spawnPos, rotation);
|
GameObject proj = Instantiate(skill.Data.AttackEffectPrefab, spawnPos, rotation);
|
||||||
|
|
||||||
// 투사체에 데미지 정보 전달
|
// 투사체에 데미지 정보 전달
|
||||||
// proj.GetComponent<Projectile>()?.Init(skill.CurrentLevelData.Damage * chargeRatio);
|
// proj.GetComponent<Projectile>()?.Init(skill.CurrentLevelData.Damage * chargeRatio);
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user