/// <summary> /// Assumes that a unit exists at the tile, and selects it. /// </summary> public void SelectTile(Tile t) { selectedCharacter = null; selectedUnit = t.currUnit; tileHighlighter.ClearHighlightedTiles(); switch (selectedUnit.unitType) { case UnitType.Character: selectedCharacter = (GameCharacter)selectedUnit; if (!selectedCharacter.finished) { tileHighlighter.HighlightTilesInPathingRange(t, selectedCharacter.move.movesLeft, Color.white, true); } break; case UnitType.Link: GameUnitLink temp = (GameUnitLink)selectedUnit; SelectTile(temp.head.currTile); return; } tileHighlighter.HighlightTile(t, HighlightStyle.Border, Color.green); unitCard.UpdateCard(selectedUnit, true); }
/// <summary> /// Assumes that a unit exists at the tile, and selects it. /// </summary> public void SelectTile(Tile t) { spawnSelected = false; if (spawnTiles.Contains(t)) { spawnSelected = true; } selectedUnit = t.currUnit; tileHighlighter.ClearHighlightedTiles(); if (selectedUnit.unitType == UnitType.Character) { selectedCharacter = (GameCharacter)selectedUnit; } unitCard.UpdateCard(selectedUnit, false); tileHighlighter.HighlightTile(t, HighlightStyle.Border, Color.green); }