Exemplo n.º 1
0
    IEnumerator WaitForStats()
    {
        string   username = GameObject.Find("GameController").GetComponent <GameController>().selectedProfile;
        DbLoader db       = GameObject.Find("DbLoader").GetComponent <DbLoader>();

        yield return(db.GetUserScore(username));

        yield return(db.GetUserDeath(username));

        yield return(db.GetUserLabdone(username));

        statsScore.text   = db.score.ToString();
        statsDeath.text   = db.death.ToString();
        statsLabdone.text = db.labdone.ToString();
    }
Exemplo n.º 2
0
    public IEnumerator Win()
    {
        Debug.Log("Win!");
        Cursor.visible   = true;
        Cursor.lockState = CursorLockMode.None;
        DbLoader db = GameObject.Find("DbLoader").GetComponent <DbLoader>();

        yield return(db.GetUserScore(selectedProfile));

        yield return(db.GetUserLabdone(selectedProfile));

        yield return(db.UpdateScore(selectedProfile, db.score + 100));

        yield return(db.UpdateLabDone(selectedProfile, db.labdone + 1));

        menuInstance.ShowMenu();
        menuInstance.DisplayWin();
        Destroy(labyrinthInstance.gameObject);

        foreach (Transform child in GameObject.Find("LabyrinthObjects").transform)
        {
            Destroy(child.gameObject);
        }
    }