void SubComponentDestroyed(SubComponent s) { s.Destroy(); Ability ToModify; Abilities.TryGetValue(s.AbilityType, out ToModify); if (ToModify != null) { int index = 0; foreach (float f in s.Modifiers) { switch (index) { case (0): { ToModify.Rating *= f; break; } case (1): { ToModify.Rating2 *= f; break; } case (2): { ToModify.Rating3 *= f; break; } case (3): { ToModify.thrust *= f; break; } } index++; } } }