88 lines
1.8 KiB
C#
88 lines
1.8 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Text.RegularExpressions;
|
|
using UnityEngine;
|
|
|
|
namespace SimpleInventorySystem
|
|
{
|
|
public enum ItemTags
|
|
{
|
|
Any,
|
|
Helmet,
|
|
Headset,
|
|
Glasses,
|
|
FaceCover,
|
|
Plate,
|
|
Weapon,
|
|
Sidearm,
|
|
MeleeWeapon,
|
|
TacticalRig,
|
|
TacticalRigAttachment,
|
|
MedPouch,
|
|
Backpack,
|
|
Pouch1x1,
|
|
Pouch2x1,
|
|
Pouch3x1,
|
|
Pouch2x2,
|
|
BodyArmor,
|
|
PlateCarrier,
|
|
HeavyAmmunition,
|
|
MediumAmmunition,
|
|
LightAmmunition,
|
|
ShotgunRounds,
|
|
Ammo
|
|
}
|
|
|
|
public enum ItemCategory
|
|
{
|
|
Gear,
|
|
Ammo
|
|
|
|
}
|
|
|
|
public enum ItemSubCategory
|
|
{
|
|
PlateCarriers,
|
|
TacticalRig,
|
|
Backpack,
|
|
|
|
}
|
|
|
|
public enum RarityType
|
|
{
|
|
Common,
|
|
Uncommon,
|
|
Rare,
|
|
Epic,
|
|
Legendary
|
|
}
|
|
|
|
[Serializable]
|
|
public class Rarity
|
|
{
|
|
public RarityType rarityType;
|
|
public Color color;
|
|
}
|
|
|
|
|
|
public class InventorySystemPreferences
|
|
{
|
|
// This class is simply there for convenience. The bulk of this file will contain elements that the game developer or programmer can modify to extend their game.
|
|
|
|
|
|
public static Dictionary<ItemCategory, ItemSubCategory> ItemCategorySubcategoryMapping = new Dictionary<ItemCategory, ItemSubCategory>()
|
|
{
|
|
{ ItemCategory.Gear, ItemSubCategory.PlateCarriers }
|
|
};
|
|
|
|
public static string SeparateWords(string input)
|
|
{
|
|
string output = input;
|
|
//Regex.Replace(output, "(\\B[A-Z])", " $1");
|
|
Regex.Replace(output, "(\\B[A-Z0-9])", " $1");
|
|
return output;
|
|
}
|
|
}
|
|
}
|