/// <summary> /// Removes the health and makes a game object dead /// </summary> /// <param name="health"></param> private void RemoveHealth(HealthComponent health) { int id = health.Parent.Id; HealthInfo info; if (!_healthMap.TryGetValue(id, out info)) return; _healthMap.Remove(id); if (info.Dead) { _aliveCount--; _deadCount++; } }
/// <summary> /// Activates the health and makes a game object alive /// </summary> /// <param name="health">Health</param> private void ActivateHealth(HealthComponent health) { HealthInfo info = EnsureHealthInfo(health.Parent.Id); info.Dead = false; info.Health = health; _aliveCount++; }