public void Damage(float damage) { m_CurrentHealth -= damage; if (m_HealthSlider != null) { m_HealthSlider.value = m_CurrentHealth / m_MaximumHealth; } if (m_DamageFlash != null) { //if(lastDamagedBy == GameManager.s_Instance.GetLocalPlayerID()) { m_DamageFlash.StartDamageFlash(); } } if (!m_IsDead && (m_CurrentHealth <= 0f)) { OnDied(); } }
//Signals the attached DamageOutlineFlash script to pulse the tank's outline in response to damage. public void StartDamageFlash() { m_DamageFlash.StartDamageFlash(); }