// データの更新 public void UpdateStatus(BaseStatus characterStatus, Status status, int destinationValue) { if (status == Status.HP) { characterStatusDictionary[characterStatus].Find("HPSlider").GetComponent <Slider>().value = (float)destinationValue / characterStatus.GetMaxHp(); characterStatusDictionary[characterStatus].Find("HPSlider/HPText").GetComponent <Text>().text = destinationValue.ToString(); } else if (status == Status.MP) { characterStatusDictionary[characterStatus].Find("MPSlider").GetComponent <Slider>().value = (float)destinationValue / characterStatus.GetMaxMp(); characterStatusDictionary[characterStatus].Find("MPSlider/MPText").GetComponent <Text>().text = destinationValue.ToString(); } }
public void SetMp(int mp) { this.mp = Mathf.Max(0, Mathf.Min(baseStatus.GetMaxMp(), mp)); }