Пример #1
0
 public void GetDamage(float damage, Vector2 posEnemie)
 {
     base.GetDamage(damage);
     spriteEffect.CancelEffect();
     spriteEffect.StartInvunerable();
     playerController.StartCoroutine(TimeDesactiveControlls(0.4f));
     RgbChar.velocity = Vector2.zero;
     animChar.SetInteger("AnimState", 0);
     if (posEnemie.x >= transform.position.x)
     {
         RgbChar.AddForce(new Vector2(-directionKnowBack.x, directionKnowBack.y) * forceKnowBack);
     }
     else
     {
         RgbChar.AddForce(new Vector2(directionKnowBack.x, directionKnowBack.y) * forceKnowBack);
     }
 }