스킬 발사체에 데미지 적용하는 로직 추가
This commit is contained in:
@@ -9,9 +9,15 @@ namespace TON
|
||||
private float elapsedTime; // 경과 시간 저장 변수
|
||||
public float destoryTime = 2f;
|
||||
|
||||
public float attackPower;
|
||||
public float damage;
|
||||
public string id = "K0002";
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
elapsedTime = 0f; // 오브젝트가 활성화될 때 초기화
|
||||
damage = SkillDataManager.Singleton.GetSkillData(id).damage;
|
||||
attackPower = PlayerDataManager.Singleton.player.attackPower;
|
||||
}
|
||||
|
||||
void Update()
|
||||
@@ -29,6 +35,7 @@ namespace TON
|
||||
{
|
||||
if (collision.CompareTag("Monster")) // 적과 충돌 시 제거
|
||||
{
|
||||
collision.GetComponent<IDamage>().ApplyDamage(damage * attackPower);
|
||||
ReleaseObject();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user