I've made a mental slide, but if the mental slide drops, I want to make the maximum value of the hp slide decrease, and I can't pull the slide because of the access ban, so how do I approach it?
This code was added to 'hpmoritor'
public Slider Mentalslider;
float mentalgage;
private void UpdateUI(Damageable damageable){
if (Mentalslider.value > 70f)
h = 1;
else{
h = 0.5f;}
m_Slider.maxValue = h * m_Damageable.MaxHp;
m_Slider.value = 100 * m_Damageable.CurrentHp / (float)m_Damageable.MaxHp;
m_HpTextText.text = m_Damageable.CurrentHp.ToString().PadLeft(3) + " / " + (h * m_Damageable.MaxHp).ToString();
}
What's the problem?
This code was added to 'hpmoritor'
public Slider Mentalslider;
float mentalgage;
private void UpdateUI(Damageable damageable){
if (Mentalslider.value > 70f)
h = 1;
else{
h = 0.5f;}
m_Slider.maxValue = h * m_Damageable.MaxHp;
m_Slider.value = 100 * m_Damageable.CurrentHp / (float)m_Damageable.MaxHp;
m_HpTextText.text = m_Damageable.CurrentHp.ToString().PadLeft(3) + " / " + (h * m_Damageable.MaxHp).ToString();
}
What's the problem?