- Home /
Question by
FlyTroll · Dec 26, 2015 at 11:12 AM ·
inventoryinventory system
How to split the objects in the inventory
using System;
[Serializable]
public class ISItem
{
public int Id;
public string Name;
}
[Serializable]
public class ISWeapon : ISItem
{
public int Damage;
public int Level;
public ISWeapon(int id, string name, int damage, int level)
{
Id = id;
Name = name;
Damage = damage;
Level = level;
}
}
[Serializable]
public class ISArmor : ISItem
{
public int Armor;
public int ArmorSpeedMod;
public ISArmor(int id, string name, int armor, int mass)
{
Id = id;
Name = name;
Armor = armor;
ArmorSpeedMod = mass;
}
}
public class ISItemList : MonoBehaviour {
public static List<?????> WeaponList = new List<??????>();
}
How i can add objects(ISArmor, ISWeapon and other) to List List = new List(); or array????
Comment