private void Show(DataUnitParam _unit) { m_goRoot.SetActive(true); _unit.RefreshAssist(DataManager.Instance.m_masterEquip.list, DataManager.Instance.m_dataEquip.list); m_txtLevel.text = $"Level:{_unit.level}"; m_txtHP.text = $"HP:{_unit.hp_current}/{_unit.hp}"; m_txtTP.text = $"TP:{_unit.tp_current}/{_unit.tp}"; m_txtAttack.text = $"{_unit.GetStatus("attack")}"; m_txtDefence.text = $"{_unit.GetStatus("defense")}"; m_txtSpeed.text = $"{_unit.GetStatus("speed")}"; m_txtMind.text = $"{_unit.GetStatus("mind")}"; m_txtWisdom.text = $"{_unit.GetStatus("wisdom")}"; }
public void Diff(DataUnitParam _unit, DataUnitParam _change) { int iHP = _change.GetStatus("hp") - _unit.GetStatus("hp"); int iTP = _change.GetStatus("tp") - _unit.GetStatus("tp"); int iAttack = _change.GetStatus("attack") - _unit.GetStatus("attack"); int iDefense = _change.GetStatus("defense") - _unit.GetStatus("defense"); int iSpeed = _change.GetStatus("speed") - _unit.GetStatus("speed"); int iMind = _change.GetStatus("mind") - _unit.GetStatus("mind"); int iWisdom = _change.GetStatus("wisdom") - _unit.GetStatus("wisdom"); int[] param_diff_arr = new int[] { iHP, iTP, iAttack, iDefense, iSpeed, iMind, iWisdom }; int[] param_after_arr = new int[] { _change.GetStatus("hp"), _change.GetStatus("tp"), _change.GetStatus("attack"), _change.GetStatus("defense"), _change.GetStatus("speed"), _change.GetStatus("mind"), _change.GetStatus("wisdom") }; TextMeshProUGUI[] tmp_arr = new TextMeshProUGUI[] { m_txtsetNext.m_txtHP, m_txtsetNext.m_txtTP, m_txtsetNext.m_txtAttack, m_txtsetNext.m_txtDefense, m_txtsetNext.m_txtSpeed, m_txtsetNext.m_txtMind, m_txtsetNext.m_txtWisdom, }; for (int i = 0; i < param_diff_arr.Length; i++) { if (0 < param_diff_arr[i]) { tmp_arr[i].text = $"<color=blue>{param_after_arr[i]}(+{param_diff_arr[i].ToString()})</color>"; //tmp_arr[i].color = Color.blue; } else if (param_diff_arr[i] < 0) { tmp_arr[i].text = $"<color=red>{param_after_arr[i]}({param_diff_arr[i].ToString()})</color>"; } else { tmp_arr[i].text = ""; } } }
public void Initialize(DataUnitParam _unit, DataUnitParam _change) { _unit.RefreshAssist(DataManager.Instance.m_masterEquip.list, DataManager.Instance.m_dataEquip.list); _change.RefreshAssist(DataManager.Instance.m_masterEquip.list, DataManager.Instance.m_dataEquip.list); m_txtsetPrev.SetComponent(transform.Find("paramRoot"), "params/txtPrev"); m_txtsetNext.SetComponent(transform.Find("paramRoot"), "params/txtNext"); m_txtsetPrev.m_txtHP.text = _unit.GetStatus("hp").ToString(); m_txtsetPrev.m_txtTP.text = _unit.GetStatus("tp").ToString(); m_txtsetPrev.m_txtAttack.text = _unit.GetStatus("attack").ToString(); m_txtsetPrev.m_txtDefense.text = _unit.GetStatus("defense").ToString(); m_txtsetPrev.m_txtSpeed.text = _unit.GetStatus("speed").ToString(); m_txtsetPrev.m_txtMind.text = _unit.GetStatus("mind").ToString(); m_txtsetPrev.m_txtWisdom.text = _unit.GetStatus("wisdom").ToString(); Diff(_unit, _change); }