public void DrawCells(RectangleSlot slot, float offsetX, float offsetY, ItemPosition position, ItemSize size, Texture2D image) { Rect cellRect = new Rect(); cellRect.x = offsetX+(position.X-1) * CellSettings.cellWidth + CellSettings.cellPaddingX + slot.position.OffsetX; cellRect.y = offsetY+(position.Y-1) * CellSettings.cellHeight + CellSettings.cellPaddingY + slot.position.OffsetY; cellRect.width = CellSettings.cellWidth * size.getWidth(); cellRect.height = CellSettings.cellHeight * size.getHeight(); GUI.color = Color.white; GUI.DrawTextureWithTexCoords(cellRect, image, textCoords); }
void Start() { selectCellImage = DImageList.getInstance().getImage("inventory_selected_cell"); correctCellImage = DImageList.getInstance().getImage("inventory_correct_cell"); errorCellImage = DImageList.getInstance().getImage("inventory_error_cell"); drawService = new SlotDrawService(slots, iconStyle, iconShadow); eventData = new EventContainer(); selectedCell = new ItemPosition(-1, -1); popupMenu.SetupListeners(toolTip); #if UNITY_EDITOR debugMode = false; #endif }