Exemplo n.º 1
0
    private void Awake()
    {
        gameController = FindObjectOfType <GameController>();
        if (gameController.cur_level == 0 && PlayerPrefs.GetInt("Hint1") == 1)
        {
            hint1.gameObject.SetActive(true);
            hint1.GetComponentInChildren <Button>().onClick.AddListener(() => { OnClickCancelInHint(1); });
        }
        else if (gameController.cur_level == 1 && PlayerPrefs.GetInt("Hint2") == 1)
        {
            hint2.gameObject.SetActive(true);
            hint2.GetComponentInChildren <Button>().onClick.AddListener(() => { OnClickCancelInHint(2); });
        }
        else if (gameController.cur_level == 2 && PlayerPrefs.GetInt("Hint3") == 1)
        {
            hint3.gameObject.SetActive(true);
            hint3.GetComponentInChildren <Button>().onClick.AddListener(() => { OnClickCancelInHint(3); });
        }

        Debug.Log("Current Level: " + Convert.ToString(gameController.cur_level + 1));
        win = 0;
        if (gameController.gameplay_enetrance == 0)
        {
            getMapDataFromLocalFile(gameController.cur_level + 1);
        }
        else
        {
            getMapDataFromLocalJson();
        }


        AnalyticsHelper.time_startPlayingLevel = Time.realtimeSinceStartup;
        AnalyticsHelper.AddTry(gameController.cur_level);
        Analytics.CustomEvent("level_start", new Dictionary <string, object>
        {
            { "level_index", gameController.cur_level },
            { "session_id", AnalyticsSessionInfo.sessionId },
            { "user_id", AnalyticsSessionInfo.userId }
        });
    }