/** * Factory for building the InventoryGUI * * @param GameObject parent The parent game object to attach * the GUI window to * @param Inventory inventory The inventory * @param Vector2 itemOffset The x, y offset of the items displaying * in the GUI window * @param int tilesize The size of the tiles (they're square) * @param Rect windowSize The size of the GUI Window * **/ public static InventoryGUI CreateComponent(GameObject parent, Inventory inventory, Vector2 itemOffset, int tilesize, Rect windowSize, Rect draggableArea) { InventoryGUI inventoryGUI = parent.AddComponent <InventoryGUI>(); inventoryGUI.itemOffset = itemOffset; inventoryGUI.tilesize = tilesize; inventoryGUI.windowRect = windowSize; inventoryGUI.draggableArea = draggableArea; inventoryGUI.Hide(); return(inventoryGUI); }
/** * Hide the inventory GUI **/ public void Hide() { inventoryGUI.Hide(); }