Hi All,
Need some thoughts and Idea on an issue I am having. So I have a Inventory and Storage system I am trying to figure out. Instead of trying to explain it, below is a screenshot. You have the Station storage and the Ship inventory. The two arrows are used to transfer inventory from one to the other.
So I successfully have the buttons setup using Event Trigger for PointerDown and PointerUp. These then call simple functions in a script to set a bool True for PointerDown and false for PointerUp. In Update() I have the code below to do the transfer and all that jazz.
The issue I have is with the buttons itself. It works wonderfully when I click and hold down the button how ever if I try to click just once it still transfers 3 to 10 int so basically I would like to lower the sensitivity or add some delay to slow down this function to make it more user friendly. Was hoping someone had some clever ideas on how to do this, thanks!
//Iron StorageUpdate
if (IronToStorageDownClick)
{
if (inv.Iron > 0)
{
if (stor_Iron < stor_maxCargo)
{
inv.Iron = inv.Iron - subTractby;
stor_Iron = stor_Iron + subTractby;
}
}
}
if (IronToInventoryDownClick)
{
if (stor_Iron > 0)
{
if (inv.Iron < shipStats.maxCargo)
{
inv.Iron = inv.Iron + subTractby;
stor_Iron = stor_Iron - subTractby;
}
}
}