void Unequip(int index) { if (index > -1) { PlayerSession.GetEquipment(index).isUsed = false; } }
public void CalculateEqAttribute() { ResetEquipmentAttribute(); AddAllEquipmentAttrib(PlayerSession.GetEquipment(battleSetting.mainHand)); AddAllEquipmentAttrib(PlayerSession.GetEquipment(battleSetting.offHand)); AddAllEquipmentAttrib(PlayerSession.GetEquipment(battleSetting.head)); AddAllEquipmentAttrib(PlayerSession.GetEquipment(battleSetting.body)); AddAllEquipmentAttrib(PlayerSession.GetEquipment(battleSetting.acc1)); AddAllEquipmentAttrib(PlayerSession.GetEquipment(battleSetting.acc2)); }
void LoadEquipmentName(Text text, int index) { if (index < 0) { text.text = "None"; } else { text.text = PlayerSession.GetEquipment(index).name; } text.GetComponent <EquipedItemUI>().SetModel(PlayerSession.GetEquipment(index)); }
public void OnItemEquiped(int index) { switch (selectedSlot) { case 0: Unequip(model.battleSetting.mainHand); model.battleSetting.mainHand = index; break; case 1: Unequip(model.battleSetting.offHand); model.battleSetting.offHand = index; break; case 2: Unequip(model.battleSetting.head); model.battleSetting.head = index; break; case 3: Unequip(model.battleSetting.body); model.battleSetting.body = index; break; case 4: Unequip(model.battleSetting.acc1); model.battleSetting.acc1 = index; break; case 5: Unequip(model.battleSetting.acc2); model.battleSetting.acc2 = index; break; } PlayerSession.GetEquipment(index).isUsed = true; LoadAllEquipments(); LoadAllAttributes(); CloseSelection(); }