fixed unity inventory and texts
This commit is contained in:
@@ -30,7 +30,6 @@ namespace Assets.Scripts
|
||||
TooltipHandler tooltip;
|
||||
|
||||
public GameObject currentSlot;
|
||||
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
@@ -50,18 +49,19 @@ namespace Assets.Scripts
|
||||
|
||||
private void createStatBoost()
|
||||
{
|
||||
if (statBoost == null)
|
||||
{
|
||||
statBoost = new Dictionary<string, int>();
|
||||
statBoost.Add("HP", 0);
|
||||
statBoost.Add("MP", 0);
|
||||
statBoost.Add("HPR", 0);
|
||||
statBoost.Add("MPR", 0);
|
||||
statBoost.Add("STR", 0);
|
||||
statBoost.Add("DEX", 0);
|
||||
statBoost.Add("INT", 0);
|
||||
statBoost.Add("LCK", 0);
|
||||
}
|
||||
statBoost = new Dictionary<string, int>();
|
||||
statBoost.Add("HP", 0);
|
||||
statBoost.Add("MP", 0);
|
||||
statBoost.Add("HPR", 0);
|
||||
statBoost.Add("MPR", 0);
|
||||
statBoost.Add("STR", 0);
|
||||
statBoost.Add("DEX", 0);
|
||||
statBoost.Add("INT", 0);
|
||||
statBoost.Add("LCK", 0);
|
||||
}
|
||||
|
||||
void OnDisable(){
|
||||
statBoost = new Dictionary<string, int>();
|
||||
}
|
||||
|
||||
public void addItem(Item item)
|
||||
@@ -195,6 +195,41 @@ namespace Assets.Scripts
|
||||
public Dictionary<string, int> getEquipmentBonus()
|
||||
{
|
||||
createStatBoost();
|
||||
GameObject equip = head;
|
||||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
switch (i)
|
||||
{
|
||||
case 0:
|
||||
equip = head;
|
||||
break;
|
||||
case 1:
|
||||
equip = rightHand;
|
||||
break;
|
||||
case 2:
|
||||
equip = leftHand;
|
||||
break;
|
||||
case 3:
|
||||
equip = amulet;
|
||||
break;
|
||||
case 4:
|
||||
equip = feet;
|
||||
break;
|
||||
case 5:
|
||||
equip = shoulders;
|
||||
break;
|
||||
case 6:
|
||||
equip = chest;
|
||||
break;
|
||||
case 7:
|
||||
equip = ring;
|
||||
break;
|
||||
}
|
||||
if (equip.GetComponent<InventorySlot>().getEquip() != null)
|
||||
{
|
||||
calculateStatBoost(equip.GetComponent<InventorySlot>().getEquip().getAttributes(), true);
|
||||
}
|
||||
}
|
||||
return statBoost;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user