示例#1
0
        public void Equip(EquipmentItemExample item)
        {
            if (item.equipmentType == Category.Head)
            {
                if (head != null)
                {
                    head.stats.RemoveAdjustment(stats);
                }

                head = item;
                if (head != null)
                {
                    head.stats.ApplyAdjustment(stats);
                }
            }
            else if (item.equipmentType == Category.Armor)
            {
                if (armor != null)
                {
                    armor.stats.RemoveAdjustment(stats);
                }

                armor = item;
                if (armor != null)
                {
                    armor.stats.ApplyAdjustment(stats);
                }
            }
        }
示例#2
0
 public void Unequip(EquipmentItemExample item)
 {
     if (item.equipmentType == Category.Head && item == head)
     {
         if (head != null)
         {
             head.stats.RemoveAdjustment(stats);
         }
         head = null;
     }
     else if (item.equipmentType == Category.Armor && item == armor)
     {
         if (armor != null)
         {
             armor.stats.RemoveAdjustment(stats);
         }
         armor = null;
     }
 }