hi, i want to use a enum from another script, but i dont know how… i’m making an inventory, and i want to when i drag and drop a item to verify if the item that i just drop is from the same type of the item that is already in the slot, and if it is to change the sprite.
this is my code (i’m just going to put here the part of the drop the item)
this is the parte of the script from inventory:
Class Inventory:
//drop the item in other slot
if (e.type == EventType.mouseUp && draggingItem) {
//verefy if the object is the same type of the other
if (draggingItem == Item.ItemType.OtherObjects) {
//change the sprite
}
}
else {
inventory [prevIndex] = inventory *;*
_ inventory = draggedItem;_
* draggingItem = false;*
* draggedItem = null;*
}
and this is from the Item, where i have the enum:
Class Item:
public enum ItemType
* {*
* DoorKeys,*
* Papers,*
* OtherObjects,*
* chaveParte*
* }*