Example #1
0
    private IEnumerator PlaceTilesAnimation()
    {
        preventInteraction.SetActive(true);
        Vector3 worldPos = new Vector3();

        foreach (Vector3Int v in selectedPositions)
        {
            worldPos += map.GetCellCenterWorld(v);
        }
        foreach (Vector3Int v in possiblePositions)
        {
            worldPos += map.GetCellCenterWorld(v);
        }
        worldPos = worldPos / (selectedPositions.Count + possiblePositions.Count);
        List <Vector3Int> all = new List <Vector3Int>(selectedPositions);

        all.AddRange(possiblePositions);
        yield return(cardSelector.PlaceCard(targetCard, worldPos, targetShape.GetRotation(all, Random.value < 0.5)));

        PlaceTargetShape();
        preventInteraction.SetActive(false);
    }