Hey,
I have been working on a trading system for some time and I got everything to work, but the menu is extremely laggy. The performance is about 170 FPS when I am not in the trade menu, but as soon as I open it, my frames drop to about 20 FPS and I have no clue why. I am using the exact same method of drawing these elements as in my inventory and the inventory stays at constant 170 FPS. Maybe you guys can help me somehow, I am clueless. I have tried so many things and nothing even slightly increased the frame rate.
The problem is the ShowTradeOptions() method.
List<Item> tradeItems = new List<Item>();
Item selectedItem = new Item();
Rect moveRightButtonRect, moveLeftButtonRect;
void ShowTradeOptions()
{
for (int i = 0; i < availableItems.Count; i++)
{
GUI.Box(myItemsRects*, "", gameDatabase.inventorySkin.GetStyle("Slot"));*
GUI.DrawTexture(myItemsRects_, availableItems*.itemIcon);*_
GUI.Box(tradeItemsRects*, “”, gameDatabase.inventorySkin.GetStyle(“Slot”));*
GUI.DrawTexture(tradeItemsRects_, tradeItems*.itemIcon);
}
}*_