// Receive damage by weapon public void ReceiveDamage(float damage) { try { health.LoseHealth(damage); NotifyHUD(); ApplyMainTexture(); ApplySmokeEffect(); } catch (Exception) { NotifyHUD(); GameController.instance.notifyDeath(this); } }
// Receive damage by weapon public void ReceiveDamage(float damage) { try { health.LoseHealth(damage); NotifyHUD(); //change texture if hp is bellow 50% if (health.GetCurrentHealthPercentage() < damageThreshold) { skin.material.mainTexture = damagedTexture; } } catch (Exception) { NotifyHUD(); Die(); } }