void Update() { Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); Vector3 mousePos = ray.GetPoint(25); Vector3 toPos = new Vector3(Mathf.RoundToInt(mousePos.x), Mathf.RoundToInt(mousePos.y), 0); if (!Input.GetMouseButton(0) && characterState == state.moving) { EndTurn(); } if (characterState == state.moving) { OnMovingState(toPos); } else { mapManager.BookTile(transform.position, team); } AdjustColor(); }