this code dont show up in the on click event in a button and i dont know why
can anyone help my plzz?
public void BuyShip(GameObject shipPrefab, int iron, int gold, int wood)
{
if(BoatInv.gold >= gold && BoatInv.iron >= iron && BoatInv.wood >= wood)
{
BoatInv.gold = BoatInv.gold - gold;
BoatInv.iron = BoatInv.iron - iron;
BoatInv.wood = BoatInv.wood - wood;
GameObject Ship = Instantiate(shipPrefab, ShipSpawn.position, Quaternion.identity);
}
else
{
textLittleResourses.SetActive(true);
}
}