예제 #1
0
    public void StartTimedGame(TimePack pack, int time)
    {
        Debug.Log("Start Timed Game (" + pack.boardSize + "," + pack.boardSize + ") - " + time + "seconds");
        GUI_Animation.SwitchMenus(GUI_Controller.instance.gui_Time, GUI_Controller.instance.gui_GameTimed);

        gameTimed.InitializeTimedGame(pack, time);
        //gameRegular.InitializeTimedGame(pack, time);
    }
예제 #2
0
    void OnButton_Time(object sender, ButtonPressedEventArgs e)
    {
        TimePack pack = GUI_Controller.instance.gui_Time.GetComponent <Time_Script>().currentPack;

        switch (e.id)
        {
        case "top_back_Button":                 //TIME - BACK
            Debug.Log(e.id + " - TIME - BUTTON BACK");
            GUI_Animation.SwitchMenus(GUI_Controller.instance.gui_Time, GUI_Controller.instance.gui_Main);
            break;

        case "buttons_boards_Button":                 //TIME - BOARDS
            Debug.Log(e.id + " - TIME - BUTTON BOARDS");
            GUI_Time.boardSize_Panel_gameObject.SetActive(true);
            break;

        case "buttons_t30_Button":                 //TIME - T30
            Debug.Log(e.id + " - TIME - BUTTON T30");
            Controller.instance.StartTimedGame(pack, 30);
            break;

        case "buttons_t60_Button":                 //TIME - T60
            Debug.Log(e.id + " - TIME - BUTTON T60");
            Controller.instance.StartTimedGame(pack, 60);
            break;

        case "buttons_t90_Button":                 //TIME - T90
            Debug.Log(e.id + " - TIME - BUTTON T90");
            Controller.instance.StartTimedGame(pack, 90);
            break;

        case "buttons_t120_Button":                 //TIME - T120
            Debug.Log(e.id + " - TIME - BUTTON T120");
            Controller.instance.StartTimedGame(pack, 120);
            break;

        case "buttons_t180_Button":                 //TIME - T180
            Debug.Log(e.id + " - TIME - BUTTON T180");
            Controller.instance.StartTimedGame(pack, 180);
            break;

        //case "buttons_t240_Button": //TIME - T240
        //	Debug.Log(e.id + " - TIME - BUTTON T240");
        //	Controller.instance.StartTimedGame(pack, 240);
        //	break;
        case "boardSize_sideClose_Button":                 //TIME - SIDECLOSE
        //Debug.Log(e.id + " - TIME - BUTTON SIDECLOSE");
        case "boardSize_content_ok_Button":                //TIME - OK
        //Debug.Log(e.id + " - TIME - BUTTON OK");
        case "boardSize_content_close_Button":             //TIME - CLOSE
            //Debug.Log(e.id + " - TIME - BUTTON CLOSE");
            GUI_Time.boardSize_Panel_gameObject.SetActive(false);
            break;

        default:
            break;
        }
    }
예제 #3
0
    public void Inititalize(TimePack _pack)
    {
        pack = _pack;

        title.text = pack.boardSize + "x" + pack.boardSize;

        this.GetComponent <UnityEngine.UI.Toggle>().group = this.transform.parent.gameObject.GetComponent <UnityEngine.UI.ToggleGroup>();

        this.GetComponent <UnityEngine.UI.Toggle>().onValueChanged.AddListener((bool value) => SetSelectedSize(value));
    }
예제 #4
0
    public void SetSelectedSize(TimePack pack)
    {
        Debug.Log("Selected Size: " + pack.boardSize);
        currentPack = pack;

        boardSizeTitle.text = currentPack.title;

        GUI_Time.buttons_t30_square_best_Text.text  = currentPack.records[0].score.ToString();
        GUI_Time.buttons_t60_square_best_Text.text  = currentPack.records[1].score.ToString();
        GUI_Time.buttons_t90_square_best_Text.text  = currentPack.records[2].score.ToString();
        GUI_Time.buttons_t120_square_best_Text.text = currentPack.records[3].score.ToString();
        GUI_Time.buttons_t180_square_best_Text.text = currentPack.records[4].score.ToString();
    }
예제 #5
0
    public void InitializeTimedGame(TimePack _pack, int _time)
    {
        Debug.Log("New Time Game: " + _time);
        currentTimeGame = _time;
        currentPack     = _pack;

        timer.StopTimer();
        timer.timeout = currentTimeGame;

        nBoardsSolved = -1;
        isBusy        = false;

        UIStartGame();

        InitializeNextBoard();

        timer.StartTimer();
    }