Exemplo n.º 1
0
 public AttDefType GetAttDefSlot(List <AttDefType> l, AttackDefenseType type)
 {
     for (int i = 0; i < l.Count; i++)
     {
         if (l[i].type == type)
         {
             return(l[i]);
         }
     }
     return(null);
 }
Exemplo n.º 2
0
        public AttackDefenseSlot GetAttackDefenseSlot(List <AttackDefenseSlot> list, AttackDefenseType attributeType)
        {
            for (int i = 0; i < list.Count; i++)
            {
                if (list[i].type == attributeType)
                {
                    return(list[i]);
                }
            }

            return(null);
        }
Exemplo n.º 3
0
        void UpdateUIAttackDefenseElement(AttackDefenseType t, List <AttDefType> l, string value, bool onText1 = false)
        {
            AttDefType s1 = weaponInfo.GetAttDefSlot(l, t);

            if (!onText1)
            {
                s1.slot.text2.text = value;
            }
            else
            {
                s1.slot.text1.text = value;
            }
        }
Exemplo n.º 4
0
        void UpdateAttackDefenseUIElement(List <AttackDefenseSlot> list, AttackDefenseType type, string value, bool onTxt1 = false)
        {
            AttackDefenseSlot attackDefSlot = weaponInfo.GetAttackDefenseSlot(list, type);

            if (!onTxt1)
            {
                attackDefSlot.slot.text2.text = value;
            }
            else
            {
                attackDefSlot.slot.text1.text = value;
            }
        }
Exemplo n.º 5
0
        void CreateAttDefUIElement_Mini(List <AttDefType> l, Transform p, AttackDefenseType t)
        {
            AttDefType a = new AttDefType();

            a.type = t;
            l.Add(a);

            GameObject g = Instantiate(weaponInfo.slot_mini) as GameObject;

            g.transform.SetParent(p);
            a.slot            = g.GetComponent <InventoryUISlot>();
            a.slot.text1.text = "-";
            g.SetActive(true);
            g.transform.localScale = Vector3.one;
        }
Exemplo n.º 6
0
        void CreateWeaponStatusSlot(List <PlayerStatusDef> l, Transform p, AttackDefenseType t, string txt1Text = null)
        {
            PlayerStatusDef w = new PlayerStatusDef();

            GameObject g = Instantiate(playerStatus.doubleSlot_template) as GameObject;

            g.SetActive(true);
            g.transform.SetParent(p);
            w.type = t;
            w.slot = g.GetComponent <InventoryUIDoubleSlot>();
            if (string.IsNullOrEmpty(txt1Text))
            {
                w.slot.text1.text = t.ToString();
            }
            else
            {
                w.slot.text1.text = txt1Text;
            }
            w.slot.text2.text      = "30";
            w.slot.text3.text      = "30";
            g.transform.localScale = Vector3.one;
        }
Exemplo n.º 7
0
        void CreateWeaponStatusSlot(List <PlayerStatusDef> list, Transform parent, AttackDefenseType type, string txt1Text = null)
        {
            PlayerStatusDef weapon = new PlayerStatusDef();
            GameObject      go     = Instantiate(playerStatus.playerStatus_DoubleSlot_Template) as GameObject;

            go.transform.SetParent(parent);
            go.SetActive(true);

            weapon.type = type;
            weapon.slot = go.GetComponent <InventoryUIDoubleSlot>();
            if (string.IsNullOrEmpty(txt1Text))
            {
                weapon.slot.text1.text = type.ToString().Replace('_', ' ');
            }
            else
            {
                weapon.slot.text1.text = txt1Text;
            }

            weapon.slot.text2.text = "30";
            weapon.slot.text3.text = "30";
        }
Exemplo n.º 8
0
        //Creating for additional effects
        void CreateAttackDefenseUIElementMini(List <AttackDefenseSlot> list, Transform parent, AttackDefenseType type)
        {
            AttackDefenseSlot attackDefense = new AttackDefenseSlot();

            attackDefense.type = type;
            list.Add(attackDefense);

            GameObject go = Instantiate(weaponInfo.slotMini) as GameObject;

            go.transform.SetParent(parent);
            go.transform.localScale = Vector3.one;

            attackDefense.slot            = go.GetComponent <InventoryUISlot>();
            attackDefense.slot.text1.text = "-";
            go.SetActive(true);
        }