Exemplo n.º 1
0
    void TouchCell(Vector3 position)
    {
        position = transform.InverseTransformPoint(position);
        CellCoords coordinates = CellCoords.FromPosition(position);

        Debug.Log("daddy touched me at " + coordinates.ToString());
    }
Exemplo n.º 2
0
    //Converts touch position to cell coordinates via the CellCoords script
    void TouchCell(Vector3 position)
    {
        position = transform.InverseTransformPoint(position);
        CellCoords coordinates = CellCoords.FromPosition(position);

        Debug.Log("contact at " + coordinates.ToString());
        int index             = coordinates.X + coordinates.Y * width;
        SquareCellScript cell = cells[index];

        cell.color = touchedColor;
    }