Simple Question about Classes and Arrays

Hey Guys,
I am working on building a simple inventory system

I made an item class:

public class GameItem {
    var ItemName : String;
    var ItemId : int;
    var ItemIcon : Texture2D; //2d picture for GUI...GUI Icon
    var ItemType : itemtype; //note the case here
    var Equipped : boolean;
    var itemValue : int;
    var itemteigue : int;

   

   
}
enum itemtype{
        weapon,
        food,
        potion,
        misc,
        tools
    }
enum potiontype{//lists out all the different item types
        fire1,
        fire2,
        fire3
    }

And I figured I would then make up arrays of this item to track what the user has. My question is lets say I have a game object that is a Sword. How would I go about setting its values for my item class before hand (such as damage, health, itemID, ItemIcon) as each of those would be specifc for each different item…

Aslo when declaring a class are you not allowed to put in if(){} statements?

Thanks!

You can just make static arrays. The best way I’ve found is to either add them all in manually via the Start/Awake methods, or make a temporary list in the inspector and set the static array to the temporary one in Start/Awake

how about creating a Dictionary rather than creating a class for each array.
check this out.