Good Day, I just want to ask if how can I do these.
I need to prevent one action from doing something if the another action is activated and vice versa . Here’s the code i have written so far.
if (hit == "spr_player")
{
betOnPlayer = true;
if (betOnBanker)
{
Debug.LogError("You already bet on the banker cannot bet on the player"); ;
}
else
{
if (betOnPlayer)
{
bet[0] = chip;
chips_bet[0].enabled = true;
Chips(chip, 0);
Debug.LogError("Betting on the player");
}
else
{
Debug.LogError("You can not bet on the Player");
}
}
}
else if (hit == "spr_banker")
{
if (betOnPlayer)
{
Debug.LogError("You already bet on the banker cannot bet on the player");
betOnBanker = true;
}
else
{
if (betOnBanker)
{
bet[4] = chip;
chips_bet[4].enabled = true;
Chips(chip, 4);
Debug.LogError("Betting on the banker");
}
else
{
Debug.LogError("You can not bet on the Banker");
}
}
}
But the problem here is that I couldn’t get to switch it on off . Could someone point out what I am doing wrong.