public void SetHpVal(string key, int oldVal, int newVal) { ItemHpBarWnd hpBar = null; if (dictItemHP.TryGetValue(key, out hpBar)) { hpBar.SetHpVal(oldVal, newVal); } }
public void SetHurt(string key, int hurt) { ItemHpBarWnd hpBar = null; if (dictItemHP.TryGetValue(key, out hpBar)) { hpBar.SetHurtVal(hurt); } }
public void SetCritical(string key, int critical) { ItemHpBarWnd hpBar = null; if (dictItemHP.TryGetValue(key, out hpBar)) { hpBar.SetCriticalVal(critical); } }
public void SetDodge(string key) { ItemHpBarWnd hpBar = null; if (dictItemHP.TryGetValue(key, out hpBar)) { hpBar.SetDodgeVal(); } }
public void RemoveHpBarItem(string name) { ItemHpBarWnd hpBar = null; if (dictItemHP.TryGetValue(name, out hpBar)) { dictItemHP.Remove(name); Destroy(hpBar.gameObject); } }
public void AddHpBarItem(string name, int hp, Transform trans) { ItemHpBarWnd item = null; if (dictItemHP.TryGetValue(name, out item)) { //return; } GameObject objHpItem = _resSvc.LoadPrefab(PathDefine.cItemHpBarPrefab, true); if (objHpItem != null) { objHpItem.transform.SetParent(transHpRoot); objHpItem.transform.localPosition = new Vector3(-1000, 0, 0); ItemHpBarWnd itemHp = objHpItem.GetComponent <ItemHpBarWnd>(); itemHp.SetInfo(hp, trans); dictItemHP.Add(name, itemHp); } }