예제 #1
0
 public void newGameButtonPressed()
 {
     PlayButton.SetActive(true);
     newGameButton.SetActive(false);
     inputField.SetActive(true);
     InfoText.SetActive(false);
 }
예제 #2
0
    public void DeleteGameButton()
    {
        GameData.currentGame.DeleteSavedGame(); //Borra archivo de datos guardados.

        //Actualizamos visualizacion interfaz.
        PlayButton.SetActive(false);
        newGameButton.SetActive(true);
        inputField.SetActive(false);
        InfoText.SetActive(false);
    }
예제 #3
0
    void ManageInput()
    {
        if (bottle.fillment.fillAmount == 1)
        {
            fingerReleased = true;
            PourAnimGO.SetActive(false);
        }

        if (Shop.activeSelf)
        {
            return;
        }

        if (Input.GetMouseButtonDown(0))
        {
            InfoText.SetActive(false);
        }

        if (Input.GetMouseButton(0) && !fingerReleased && !resetingGame)
        {
            // Player is holding the screen --> fill

            bottle.Fill(0.2f, pourSpeed);
            dispenser.Dispense(0.2f, pourSpeed);

            pourAudio.enabled = true;

            firstGame = 1;
            PlayerPrefs.SetInt("first", firstGame);
            PlayerPrefs.Save();

            Debug.Log(firstGame);

            ClickToStartAnim.SetTrigger("Fade");
            DispenserAnim.SetBool("DispenserUp", false);
            DispenserAnim.SetBool("DispenserDown", true);
            PourAnimGO.SetActive(true);
        }

        if (Input.GetMouseButtonUp(0))
        {
            pourAudio.enabled = false;
            fingerReleased    = true;
            PourAnimGO.SetActive(false);
        }
    }
예제 #4
0
    public void StartGame()
    {
        if (firstGame == 1)
        {
            InfoText.SetActive(false);
        }
        else if (firstGame == 0)
        {
            InfoText.SetActive(true);
        }

        Shop.SetActive(false);

        bottle = FindObjectOfType <BottleScript>();

        currentFillLine = GameObject.Find("FillmentLine");

        PourAnimGO.SetActive(false);

        HighScoreTxtGO.SetActive(false);
        endScreenOverlayPanel.SetActive(false);

        goalFillLineAnim.SetBool("LineSlideOut", true);

        if (FindObjectOfType <BottleScript>() != null)
        {
            PourAnimGO.GetComponent <Image>().color = bottle.liquidColor;

            // Set random position for the fill line the user has to reach.

            goalFillLine.transform.localPosition = new Vector3(-100, Random.Range(bottle.minAmount, bottle.maxAmount), 0);
        }

        //Get random dispense speed.
        SetDispenseSpeed();

        fingerReleased = false;
    }
예제 #5
0
    void Start()
    {
        audioScript = FindObjectOfType <AudioScript>();
        loader      = GetComponent <LoadingBar>();

        if (GameData.currentGame.newGame) //Si no habia partida guardada
        {
            PlayButton.SetActive(false);
            newGameButton.SetActive(true);
            inputField.SetActive(false);
            InfoText.SetActive(false);
        }
        else   //si habia partida guardada.
        {
            PlayButton.SetActive(true);
            newGameButton.SetActive(false);
            inputField.SetActive(false);
            InfoText.SetActive(true);

            InfoText.GetComponentInChildren <Text>().text = "de "
                                                            + GameData.currentGame.playerName + "\n" + GameData.currentGame.lastTimeMainScene.ToString("dd/MM/yyyy");
        }
    }