Ignore game actions, when click UI

This commit is contained in:
brausjonas
2023-02-27 22:05:47 +01:00
parent 87a13f5b43
commit e20308842a
8 changed files with 88 additions and 30 deletions
@@ -49,23 +49,29 @@ public class PlayablePlayer : Player
*/
if (activated && !name.Equals(""))
{
//Generiere Würfelzahl von 1-6 wenn gerade gewürfelt werden darf
if ((Input.GetMouseButtonDown(0) && !uiHandler.MapOpen) && wurfelZahl == 0 && !wurfelt)
{
wurfelt = true;
wurfelZahl = Random.Range(1, 7);
textLeftMoves.text = wurfelZahl + "";
if(!Physics.Raycast(new Vector3(Input.mousePosition.x, Input.mousePosition.y, -200), Vector3.forward))
{
wurfelt = true;
wurfelZahl = Random.Range(1, 7);
textLeftMoves.text = wurfelZahl + "";
client.SendWurfeln(wurfelZahl);
client.SendWurfeln(wurfelZahl);
//nächstes Feld anvisieren
TargetNextField();
//nächstes Feld anvisieren
TargetNextField();
//stop the dice
diceScript.StopRandom(wurfelZahl);
//stop the dice
diceScript.StopRandom(wurfelZahl);
//delay for walk start
timeSinceWurfeln = Time.time;
//delay for walk start
timeSinceWurfeln = Time.time;
}
}
}
}