Enum Type Inventory?

I have an “if” statement: if(curBlock = BrickType.Dirt) and I want it to see is your “Current Block” is dirt. BrickType is an enum: public enum BrickType {Dirt, ect...}, because I have many different block types. So, I want it to be so that when I break a block, it checks what type of block it is, then it adds it to your inventory, but I get the error: Assets/Scripts/PlayerIO.cs(69,31): error CS0119: Expression denotes a type’, where a variable', value’ or `method group’ was expected. So is there a way I can have it check what block it is? Also is there a easier way to add it to your inventory, instead of having an “if” statement for every block?

Your problem is that comparisons use two equal signs (‘==’), so your line should be:

if(curBlock == BrickType.Dirt)

A switch statement is bit of an improvement:

switch (curBlock) {
    case BrickType.Dirt:
    // Do the dirt stuff
    break;
    case BrickType.Plastic:
    // Do the plastic stuff
    break;
}

There may be other improvements, but I’d have to understand more about your code…in particular, why you need to know what type when adding it to the inventory.