コード例 #1
0
 void Unequip(int index)
 {
     if (index > -1)
     {
         PlayerSession.GetEquipment(index).isUsed = false;
     }
 }
コード例 #2
0
 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));
 }
コード例 #3
0
 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));
 }
コード例 #4
0
    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();
    }