Exemplo n.º 1
0
    public void Timer(float changeInTime)
    {
        timer -= changeInTime;

        if (timer <= 0)
        {
            timer = 0;
            if (!timeUp)
            {
                timeUp = true;
                Warp warpScript = FindObjectOfType <Warp>();
                StartCoroutine(warpScript.WarpTo(new Vector3(-13, -5, 0), "Office"));
                LaptopScript laptopScript = FindObjectOfType <LaptopScript>();
                laptopScript.interact();
                GameObject investigateButton = GameObject.Find("Investigate Button");
                investigateButton.GetComponent <Button>().interactable = false;
                GameObject chooseButton = GameObject.Find("Choose Button");
                chooseButton.GetComponent <Button>().interactable = true;
            }
        }

        string minutes = ((int)timer / 60).ToString();
        string seconds = (timer % 60).ToString("f1");

        timerText.text = minutes + ":" + seconds;
    }