Ejemplo n.º 1
0
        private void Tiling()
        {
            if (Input.GetMouseButtonUp(1))
            {
                selectionOrientation++;
                if ((int)selectionOrientation == orientationLength)
                {
                    selectionOrientation = 0;
                }
            }

            var ray = mainCamera.ScreenPointToRay(Input.mousePosition);

            if (Physics.Raycast(ray, out var hit))
            {
                map.SetTilesOutLine(hit.point, colors[current_player_id], selectionOrientation, true);


                if (Input.GetMouseButtonUp(0) && map.outlinedTiles.Count >= 2)
                {
                    marakeshServer.SetLastCarpetPosition(map.outlinedTiles.Select(t => Array.IndexOf(map.tiles, t)).ToList());
                    map.SetTilesColor(hit.point, colors[current_player_id]);
                    map.SetTilesOutLine(hit.point, colors[current_player_id], selectionOrientation, false);
                    GoToNextGameState();
                    marakeshServer.EndTurn();
                }
            }
        }