Пример #1
0
    public bool OnHit(EntityStats PlayerStats)
    {
        int damage = mStats.CalculateDamageReceived(PlayerStats);

        mSpriteRenderer.material = mFlashMaterial;
        Invoke("ResetMaterial", .1f);

        if (mHealthBar.OnDamaged(damage))
        {
            OnDead();
            OnEnemyDead();
            return(true);
        }
        return(false);
    }