Exemple #1
0
 protected virtual void Update()
 {
     // Getting name of holding toggle
     if (type == 1)
     {
         if (toggleGroupReference.GetComponent <ToggleGroup>().ActiveToggles().FirstOrDefault() != null)
         {
             GameObject currArmorObject = GameObject.FindObjectOfType <ToggleGroup>().ActiveToggles().FirstOrDefault().transform.parent.gameObject;
             string     currArmorSet    = currArmorObject.name;
             Sprite[]   currSprites     = currArmorObject.GetComponent <Item>().sprites;
             GameObject.Find("Player").GetComponent <PlayerGear>().SetGear(currSprites, currArmorSet);
             PlayerStats.AddBonuses(currArmorObject.GetComponent <Item>().attackBuff, currArmorObject.GetComponent <Item>().healthBuff, currArmorObject.GetComponent <Item>().defBuff);
         }
     }
     else if (type == 2)
     {
         if (toggleGroupReference.GetComponent <ToggleGroup>().ActiveToggles().FirstOrDefault() != null)
         {
             GameObject currWeaponObject = GameObject.FindObjectOfType <ToggleGroup>().ActiveToggles().FirstOrDefault().transform.parent.gameObject;
             string     currWeaponName   = currWeaponObject.name;
             Sprite[]   currSprites      = currWeaponObject.GetComponent <Item>().sprites;
             GameObject.Find("Player").GetComponent <PlayerGear>().SetWeapon(currSprites, currWeaponName);
             PlayerStats.AddBonusesWeapon(currWeaponObject.GetComponent <Item>().attackBuff, currWeaponObject.GetComponent <Item>().healthBuff, currWeaponObject.GetComponent <Item>().defBuff);
         }
     }
 }
Exemple #2
0
 protected void SetBuffsArmor()
 {
     PlayerStats.AddBonuses(attackBuff, healthBuff, defBuff);
 }