// Use this for initialization
    void Start()
    {
        DBContentProcessor dbProcessor = GameObject.Find("AIOGameManager").GetComponent <DBContentProcessor>();
        UIManager          uiManager   = GameObject.Find("AIOGameManager").GetComponent <UIManager>();

        start.onClick.AddListener(() => {
            LoadingCanvasAnimator.SetTrigger("fadeOut");

            start.interactable = false;
            txtStart.text      = "STARTING SIMULATION...";

            uiManager.sfxSpecial();
            dbProcessor.StartGame();
        });
    }
Пример #2
0
    // Use this for initialization
    private void Start()
    {
        //initilize gameobject references
        loginModule = GameObject.Find("AIOGameManager").GetComponent <LoginModule>();
        GameSettingsManager settings     = GameObject.Find("AIOGameManager").GetComponent <GameSettingsManager>();
        UIManager           ui_Manager   = GameObject.Find("AIOGameManager").GetComponent <UIManager>();
        DBContentProcessor  db_processor = GameObject.Find("AIOGameManager").GetComponent <DBContentProcessor>();

        // lock post-test buttons by default
        btnPost.interactable = false;
        btnPost.GetComponentInChildren <Text>().text  = "LOCKED";
        btnPost.GetComponentInChildren <Text>().color = Color.red;

        // rename buttons to test ID for the DB processor to read
        credentials  = txtTestID.text.Split(new char[] { '#' }, System.StringSplitOptions.RemoveEmptyEntries);
        btnPost.name = credentials[1];
        btnPre.name  = credentials[1];

        StartCoroutine(q_HighestRating("http://" + settings.link, loginModule.accountUsername, int.Parse(loginModule.userID), int.Parse(credentials[1])));

        // add functionalities to pre and post buttons
        btnPost.onClick.AddListener(() => {
            loginModule.themeMusicStop();

            ui_Manager.sfxOpen();
            db_processor.TestMode("POST");
            db_processor.OnClickTest();
        });

        btnPre.onClick.AddListener(() => {
            loginModule.themeMusicStop();

            ui_Manager.sfxOpen();
            db_processor.TestMode("PRE");
            db_processor.OnClickTest();
        });
    }