Exemplo n.º 1
0
    private void PutLabelOn(Vector2Int pos, CellLabel label)
    {
        GameCell cell = GetCell(pos);

        if (cell == null)
        {
            return;
        }

        if (cell.GetComponentInChildren <CellLabel>() == null)
        {
            label.transform.parent        = cell.transform;
            label.transform.localPosition = Vector2.zero;
        }
        else
        {
            cell.GetComponentInChildren <CellLabel>().AddContent(label.Content);
            Destroy(label.gameObject);
        }
    }