예제 #1
0
    // Update is called once per frame
    void Update()
    {
        if (IsRunning2 == 1)
        {
            if (IsRunning == 1)
            {
                Debug.Log("lvlCounter = " + lvlCounter);
                StartCoroutine(processTask());
                lvlBox.GetComponent <Text>().text = "Level " + lvlCounter;
                lvlCounter += 1;
                coins      += 1;
            }
            else if (IsRunning == 2)
            {
                StartCoroutine(firstProcessTask());
            }
        }

        if (stp == 1)
        {
            Debug.Log("Ans = " + result);
            IsRunning2 = 0;
            SceneManager.LoadScene("Answer");
            LagSound.PlaySound("complete");
            stp = 2;
        }
    }
예제 #2
0
    public void Compare(float ans, float inpt)
    {
        if (ans == inpt)
        {
            Monetki += coins - 1;
            LagSound.PlaySound("on");
            AnsBox.GetComponent <Text>().text = "" + result;
            PlayerPrefs.SetInt("Coins", Monetki);
            if (PlayerPrefs.GetInt("Highscore") < Math.lvlCounter - 1)
            {
                PlayerPrefs.SetInt("Highscore", Math.lvlCounter - 1);
            }

            if (lvlCounter - 1 >= 5)
            {
                GlobalAchivements.ach01Count = 5;
            }

            lvlCounter = 0;
            coins      = 0;
        }
        else
        {
            lvlCounter = 0;
            coins      = 0;
            LagSound.PlaySound("lose");
            AnsBox.GetComponent <Text>().text = "" + result;
        }
        result = 0;
        StartCoroutine(processTask());
    }
예제 #3
0
    IEnumerator processTask()
    {
        IsRunning = 0;
        yield return(new WaitForSeconds(SecToWait));

        Destroy(fNumbBox);

        numb = Random.Range(min, max + 1);
        sign = Random.Range(0, 2);

        TextBox.GetComponent <Text>().text = "" + numb;
        SignBox.GetComponent <Text>().text = "" + simpleMath[sign];
        LagSound.PlaySound("numb");
        Debug.Log("Number: " + result + simpleMath[sign] + numb);
        result = Calculate(sign, numb, result);
        Debug.Log(" = " + result);
        IsRunning = 1;
    }
예제 #4
0
    IEnumerator Trigger01Ach()
    {
        achActive = true;
        ach01Code = 12345;
        yield return(new WaitForSeconds(1));

        PlayerPrefs.SetInt("Ach01", ach01Code);
        LagSound.PlaySound("achivement");
        achImg.SetActive(true);
        achTitl.GetComponent <Text>().text = "New achivement";
        achDesc.GetComponent <Text>().text = "You passed 5 levels /n gj";
        ach.SetActive(true);
        yield return(new WaitForSeconds(3));

        ach.SetActive(false);
        achImg.SetActive(false);
        achTitl.GetComponent <Text>().text = "";
        achDesc.GetComponent <Text>().text = "";
        achActive = false;
    }
예제 #5
0
 public void startGame()
 {
     PlayerPrefs.SetInt("Ach01", 10000);
     SceneManager.LoadScene("PlayGround");
     LagSound.PlaySound("button1");
 }