Exemplo n.º 1
0
    override public void CheckDragDrop(Vector3 recolocationPositionValue, LastChipObject lastChipSetObject)
    {
        userWord = "";
        int  countChip = 0;
        bool firstChip = false;

        foreach (Transform child in chipsSet.transform)   //Comprueba si la palabra formada por las fichas es la ganadora
        {
            countChip++;
            if (child.name == "DropZone" && child.gameObject.activeInHierarchy)               //Es la primera ficha que se coloca
            {
                dropHereTableroJuego.enabled = true;
                child.gameObject.SetActive(false);
                firstChip = true;
            }
            if (child.tag == "Ficha")
            {
                if (firstChip)
                {
                    child.localPosition = new Vector3(0, 0);
                }
                foreach (Transform text in child.transform)
                {
                    string charWord = text.GetComponent <Text>().text;
                    userWord = userWord + charWord;
                }
            }
        }

        if (!firstChip)
        {
            stackChipSet.Push(lastChipSetObject);             //Si es primera ficha no la añadimos al stack.
        }
        CheckWordOnBoard(lastChipSetObject.lastChipSet, recolocationPositionValue, firstChip);
    }
Exemplo n.º 2
0
    override public void CheckDragDrop(Vector3 recolocationPositionValue, LastChipObject lastChipSetObject)
    {
        if (timeWithoutSet > 7.9)         //Si el jugador coloca, ocultamos la ayuda.
        {
            OnHideTimeHelp();
        }
        isFirstChipSet = true;
        timeWithoutSet = 0;
        userWord       = "";
        chipList.Clear();
        int  countChip = 0;
        bool firstChip = false;

        foreach (Transform child in chipsSet.transform)   //Comprueba si la palabra formada por las fichas es la ganadora.
        {
            countChip++;
            if (child.name == "DropZone" && child.gameObject.activeInHierarchy)   //Es la primera ficha que se coloca
            {
                dropHereTableroJuego.enabled = true;
                child.gameObject.SetActive(false);
                firstChip = true;
            }
            if (child.tag == "Ficha")
            {
                foreach (Transform text in child.transform)
                {
                    string charWord = text.GetComponent <Text>().text;
                    userWord = userWord + charWord;
                }
                chipList.Add(child);
                if (firstChip)
                {
                    chipList[0].localPosition = new Vector3(0, 0, 0);
                }
            }
        }
        if (!firstChip)
        {
            stackChipSet.Push(lastChipSetObject);
        }

        CheckWordOnBoard(lastChipSetObject.lastChipSet, recolocationPositionValue, firstChip);
    }
Exemplo n.º 3
0
 public virtual void CheckDragDrop(Vector3 recolocationPositionValue, LastChipObject lastChipSetObject)
 {
 }