public void ChangeStrength(Slider StrengthSlider) // changing shield strength with slider { if (shield.isOn) { shield.SetShieldStrength((StrengthSlider.value)); sView.UpdateShieldStrength(shield.GetShieldStrength()); StrengthSlider.gameObject.SetActive(true); // allow to move slider if shield active } else { StrengthSlider.gameObject.SetActive(false); // can't move slider if shield inactive Debug.Log("Shield is not on, can't change power."); } }
public void ChangeStrength(Slider StrengthSlider) // changing shield strength with slider { if (shield.isOn) { shield.SetShieldStrength((StrengthSlider.value)); sView.UpdateShieldStrength(shield.GetShieldStrength()); StrengthSlider.interactable = true; } else { StrengthSlider.interactable = false; // can't move slider if shield inactive Debug.Log("Shield is not on, can't change power."); } }