Exemplo n.º 1
0
    public void Injure(int dmg, GameObject who)
    {
        RPG.InjurePlayer(dmg);
        RPG.FloatingTextAbove(transform, dmg.ToString(), Color.red, 2);
        RPGSounds.Instance.PlayHitSound();
        if (who != null)
        {
            knockback.Knockback(who.transform.position, gameObject.transform.position, 10);

            /*Vector3 direction=(transform.position-who.transform.position);
             * direction.y=0;
             * direction.Normalize();
             * direction.y=+1;
             * knockback.Knockback(direction*5);
             * Debug.Log("player kb:"+direction);*/
        }
    }