I’ve been stuck on this for a few days now and decided to seek help here.
Basically, I would like to create all the weapons that my game will have, and be able to add more in the future. Each weapon will have variables attached to them.
So far, I have created a public class for the items’ details
public class Item
{
var Name : String;
var Description : String;
var ID : int;
var icon : Texture2D;
var equipped : boolean;
var Stamina : int;
var Power : float;
var AttackSpeed : float;
var Rarity : Rarity;
var itemType : ItemType;
var itemlevel : int;
}
My actual list of items is in another script. It’s just a standard builtin Array.
static var items : Item[];
I know that I can change the size in the inspector and make all my items there. But I feel that it is very fragile. I can easily accidentally move the items variable ot change the size and it would delete all my items. I would like a way to properly code each item in. Then, I can just call a weapon from the id or name to add it to my characters inventory etc.
I should also add that my game is gui based. There are inventory tutorials out there, but they all seem to be for 1st or 3rd person games and don’t necessarily apply here.