示例#1
0
    private void Awake()
    {
        gameController = FindObjectOfType <GameController>();
        mapCreator     = FindObjectOfType <MapCreator>();

        //if(gameController.gameplay_enetrance == 2)
        //{
        //    this.gameObject.SetActive(false);
        //}

        Analytics.CustomEvent("level_finish", new Dictionary <string, object>
        {
            { "level_index", gameController.cur_level },
            { "session_id", AnalyticsSessionInfo.sessionId },
            { "user_id", AnalyticsSessionInfo.userId },
            { "steps", final_step },
            { "time_elapsed", Time.realtimeSinceStartup - AnalyticsHelper.time_startPlayingLevel },
            { "tries", AnalyticsHelper.GetTries(gameController.cur_level) }
        });
        AnalyticsHelper.ResetTries(gameController.cur_level);

        if (gameController.gameplay_enetrance == 1)
        {
            next_button.gameObject.SetActive(false);
        }
    }
    private void onClickBackButton()
    {
        Analytics.CustomEvent("level_quit", new Dictionary <string, object>
        {
            { "level_index", gameController.cur_level },
            { "session_id", AnalyticsSessionInfo.sessionId },
            { "user_id", AnalyticsSessionInfo.userId },
            { "steps", final_step },
            { "time_elapsed", Time.realtimeSinceStartup - AnalyticsHelper.time_startPlayingLevel },
            { "tries", AnalyticsHelper.GetTries(gameController.cur_level) }
        });

        if (gameController.gameplay_enetrance == 0)
        {
            Debug.Log("Click On Back");
            SceneManager.LoadScene("LevelPage");
        }
        else if (gameController.gameplay_enetrance == 1)
        {
            Debug.Log("Click On Back");
            SceneManager.LoadScene("Community");
        }
        else
        {
            Debug.Log("Click On Back");
            SceneManager.LoadScene("MapDesign");
        }
    }