Beispiel #1
0
    public void SetHpVal(string key, int oldVal, int newVal)
    {
        ItemHpBarWnd hpBar = null;

        if (dictItemHP.TryGetValue(key, out hpBar))
        {
            hpBar.SetHpVal(oldVal, newVal);
        }
    }
Beispiel #2
0
    public void SetHurt(string key, int hurt)
    {
        ItemHpBarWnd hpBar = null;

        if (dictItemHP.TryGetValue(key, out hpBar))
        {
            hpBar.SetHurtVal(hurt);
        }
    }
Beispiel #3
0
    public void SetCritical(string key, int critical)
    {
        ItemHpBarWnd hpBar = null;

        if (dictItemHP.TryGetValue(key, out hpBar))
        {
            hpBar.SetCriticalVal(critical);
        }
    }
Beispiel #4
0
    public void SetDodge(string key)
    {
        ItemHpBarWnd hpBar = null;

        if (dictItemHP.TryGetValue(key, out hpBar))
        {
            hpBar.SetDodgeVal();
        }
    }
Beispiel #5
0
    public void RemoveHpBarItem(string name)
    {
        ItemHpBarWnd hpBar = null;

        if (dictItemHP.TryGetValue(name, out hpBar))
        {
            dictItemHP.Remove(name);
            Destroy(hpBar.gameObject);
        }
    }
Beispiel #6
0
    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);
        }
    }