void OnMouseOver() { // Change the Color of the GameObject when the mouse hovers over it mouseOver = true; if (gameManager.playerTurn) { mat.color = Color.white; gameManager.DrawLine(transform.position); if (Input.GetMouseButtonDown(0)) { selected = true; if (gameManager.playerTurn == true) { gameManager.MovePlayer(transform.position); } } selected = false; } }