Skip to content
Snippets Groups Projects
Commit 66aa3631 authored by YnothnaFr's avatar YnothnaFr
Browse files

PATCH : goblin hit the player even if he die

parent d3294e8a
2 merge requests!12Main,!6Ennemies controller
...@@ -66,9 +66,19 @@ public class EnnemiesAIController : MonoBehaviour ...@@ -66,9 +66,19 @@ public class EnnemiesAIController : MonoBehaviour
if (!(Time.time > AttackTime)) return; if (!(Time.time > AttackTime)) return;
Animation.Play("Attack01"); Animation.Play("Attack01");
PlayerStat.Hit(AttackDommage); if (isDead) return;
StartCoroutine(GiveDammage(AttackDommage));
AttackTime = Time.time + AttackTimeout; AttackTime = Time.time + AttackTimeout;
} }
IEnumerator GiveDammage(float hit)
{
yield return new WaitForSeconds(0.7f);
if (!isDead)
{
PlayerStat.Hit(hit);
}
}
public void GetDommage(float Dammage) public void GetDommage(float Dammage)
{ {
......
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