Пример #1
0
    public void badSelection()
    {
        fails += 1;
        diffRegulator.addFail();

        audioScript.MakeErrorSound(); //sonido de fallo al seleccionar manzana incorrecta.
    }
Пример #2
0
    public void PlayButtonPressed()
    {
        if (GameData.currentGame.newGame)
        {
            if (inputField.GetComponent <InputField>().text != "")
            {
                audioScript.MakeClickSound(); //Genera sonido de click al clicar boton play cuando este permite crear partida

                Debug.Log(inputField.GetComponent <InputField>().text);
                GameData.currentGame.playerName = inputField.GetComponent <InputField>().text;
                loader.startLoad(1);
            }
            else
            {
                audioScript.MakeErrorSound();
            }                                     //Genera sonido de error al clicar boton play no funcional
            Debug.Log(inputField.GetComponent <InputField>().text);
        }
        else
        {
            loader.startLoad(1);

            audioScript.MakeClickSound(); //Genera sonido de click al clicar boton play
        }
    }
Пример #3
0
    //FUNCIONES CREACION/PAGO DE OBJETOS//

    public void createTree()
    {
        if (GameData.currentGame.coins >= treePrize)
        {
            sceneState = "Placing";

            GameObject t = Instantiate(tree);
            objectToMove = t;


            //Establezco valores para arboles recien creados.
            objectToMove.GetComponent <AppleTree>().setWithApples(true);
            objectToMove.GetComponent <AppleTree>().timeToCollect = -1;

            gridTrees.Add(objectToMove.GetComponent <AppleTree>()); //Introduce arbol en lista de arboles en escena.
        }
        else
        {
            audioScript.MakeErrorSound();
        }                                      //Genera sonido de error al clicar sin recursos suficientes
    }