public void ActivateWeaponComponent(WeaponComponentType weaponComponentToActivate) { if (weaponType.CheckCompatibility(weaponComponentToActivate) == false) { return; } Debug.Log(weaponComponentToActivate.name + " will be activated!"); foreach (WeaponComponent wc in allAvailableWeaponComponents) { if (wc.weaponComponentType.name == baseType.name) { continue; } if (weaponComponentToActivate.name == wc.weaponComponentType.name) { Debug.Log(weaponComponentToActivate.name + " was activated in " + gameObject.name); wc.gameObject.SetActive(true); } } }