효과음 겹치는 문제 수정을 위해 효과음 재생중일때 효과음이 재생되지 않도록 수정
This commit is contained in:
@@ -24,77 +24,4 @@ namespace TON
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public class Monster1AttackPattern : AttackPattern
|
||||
{
|
||||
public Monster1AttackPattern(MonsterBase monsterBase) : base(monsterBase)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Attack()
|
||||
{
|
||||
if (Time.time >= _lastSkillTime + _skill1Cooldown)
|
||||
{
|
||||
Skill1();
|
||||
_lastSkillTime = Time.time;
|
||||
}
|
||||
else
|
||||
{
|
||||
MeleeAttack();
|
||||
}
|
||||
}
|
||||
|
||||
private void Skill1()
|
||||
{
|
||||
_monsterBase.MonsterSkillLaunch();
|
||||
}
|
||||
|
||||
private void MeleeAttack()
|
||||
{
|
||||
_monsterBase.PlayerAttack();
|
||||
}
|
||||
}
|
||||
|
||||
public class Monster2AttackPattern : AttackPattern
|
||||
{
|
||||
private float _lastSkill2Time;
|
||||
|
||||
public Monster2AttackPattern(MonsterBase monsterBase) : base(monsterBase)
|
||||
{
|
||||
_lastSkill2Time = -_skill2Cooldown;
|
||||
}
|
||||
|
||||
public override void Attack()
|
||||
{
|
||||
if (Time.time >= _lastSkillTime + _skill1Cooldown)
|
||||
{
|
||||
Skill1();
|
||||
_lastSkillTime = Time.time;
|
||||
}
|
||||
else if (Time.time >= _lastSkill2Time + _skill2Cooldown)
|
||||
{
|
||||
Skill2();
|
||||
_lastSkill2Time = Time.time;
|
||||
}
|
||||
else
|
||||
{
|
||||
MeleeAttack();
|
||||
}
|
||||
}
|
||||
|
||||
private void Skill1()
|
||||
{
|
||||
_monsterBase.MonsterSkillLaunch(1); // 스킬 1 발사
|
||||
}
|
||||
|
||||
private void Skill2()
|
||||
{
|
||||
_monsterBase.MonsterSkillLaunch(2); // 스킬 2 발사
|
||||
}
|
||||
|
||||
private void MeleeAttack()
|
||||
{
|
||||
_monsterBase.PlayerAttack();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user