Commit cd5ff227 authored by 15김민규's avatar 15김민규

공격 모션 중에는 피격돼도 Damaged나 Stunned가 아닌 이상 방향 안바뀜

parent 81ba33bb
...@@ -232,3 +232,10 @@ AnimationClip: ...@@ -232,3 +232,10 @@ AnimationClip:
floatParameter: 0 floatParameter: 0
intParameter: 0 intParameter: 0
messageOptions: 0 messageOptions: 0
- time: 1.25
functionName: whileGetHitByAttackAnim
data:
objectReferenceParameter: {fileID: 0}
floatParameter: 0
intParameter: 0
messageOptions: 0
...@@ -65,7 +65,10 @@ public class EnemyAir : Enemy { ...@@ -65,7 +65,10 @@ public class EnemyAir : Enemy {
ChangeVelocityXY(knockbackVelocity); ChangeVelocityXY(knockbackVelocity);
yield return new WaitForSeconds(knockbackTime); yield return new WaitForSeconds(knockbackTime);
ChangeVelocityXY(Vector2.zero); ChangeVelocityXY(Vector2.zero);
if (movementLock != EnemyMovementLock.Debuffed) movementLock = EnemyMovementLock.Free; if (movementLock != EnemyMovementLock.Debuffed)
{
movementLock = EnemyMovementLock.Free;
}
} }
protected override IEnumerator OnIce(float duration) protected override IEnumerator OnIce(float duration)
......
...@@ -99,7 +99,7 @@ public class EnemyGround : Enemy { ...@@ -99,7 +99,7 @@ public class EnemyGround : Enemy {
{ {
int knockbackDir = (enemyManager.Player.transform.position.x - transform.parent.position.x >= 0) ? -1 : 1; int knockbackDir = (enemyManager.Player.transform.position.x - transform.parent.position.x >= 0) ? -1 : 1;
float knockbackVelocity = knockbackDir * knockbackDist / knockbackTime; float knockbackVelocity = knockbackDir * knockbackDist / knockbackTime;
ChangeDir_movement(knockbackDir * -1); ChangeDir(knockbackDir * -1);
ChangeVelocityX(knockbackVelocity); ChangeVelocityX(knockbackVelocity);
for (float timer = 0; timer <= knockbackTime; timer += Time.deltaTime) for (float timer = 0; timer <= knockbackTime; timer += Time.deltaTime)
...@@ -128,6 +128,7 @@ public class EnemyGround : Enemy { ...@@ -128,6 +128,7 @@ public class EnemyGround : Enemy {
protected override IEnumerator OnStun(float duration) protected override IEnumerator OnStun(float duration)
{ {
animator.SetTrigger("StunnedTrigger"); animator.SetTrigger("StunnedTrigger");
yield return new WaitUntil(() => animator.GetCurrentAnimatorStateInfo(0).IsName("Stunned"));
animator.speed = stunnedAnimLength / duration; animator.speed = stunnedAnimLength / duration;
yield return new WaitForSeconds(duration); yield return new WaitForSeconds(duration);
OffDebuff(EnemyDebuffCase.Stun); OffDebuff(EnemyDebuffCase.Stun);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment