示例#1
0
 private void Start()
 {
     if (ui_question_display == null)
     {
         ui_question_display = this;
     }
 }
 // Use this for initialization
 void Start()
 {
     if (game_controller == null)
     {
         game_controller = this;
     }
     difficulty_controller = GetComponent <BP_Difficulty_Controller>();
     question_generator    = GetComponent <Question_Generator>();
     balloon_generator     = GetComponent <BP_Balloon_Generator>();
     ui_question_display   = UI_Question_Display.ui_question_display;
     Play();
 }
示例#3
0
 // Use this for initialization
 void Start()
 {
     if (game_controller == null)
     {
         game_controller = this;
     }
     ball                  = GameObject.FindObjectOfType <RB_Ball>();
     board_loader          = GameObject.FindObjectOfType <RB_Board_Loader>();
     answer_controller     = GetComponent <RB_Answer_Controller>();
     difficulty_controller = GetComponent <RB_Difficulty_Controller>();
     answer_tile           = GameObject.FindObjectOfType <RB_Answer_Tile>();
     ui_question           = UI_Question_Display.ui_question_display;
     Set_Board();
 }
示例#4
0
    void Set_Board()
    {
        //generate board
        Reset_Board_Rotation();
        board_loader.Generate_Board();
        number_tiles = FindObjectsOfType <RB_Number_Tile>();
        answer_tile  = FindObjectOfType <RB_Answer_Tile>();

        //generate answer
        answer = answer_controller.Generate_Answer(true);
        if (ui_question == null)
        {
            ui_question = UI_Question_Display.ui_question_display;
        }
        if (ui_question != null)
        {
            string question_string = answer_controller.Get_Question();
            ui_question.Set_Question("");
            ui_question.Set_Question(question_string);
        }
        else
        {
            print("UI Question not found.");
        }
        possible_answers = answer_controller.Get_Possible_Answers(number_tiles.Length);
        for (int i = 0; i < number_tiles.Length; i++)
        {
            int chosen_answer = possible_answers[i];
            while (chosen_answer == answer)
            {
                chosen_answer = possible_answers[Random.Range(0, possible_answers.Length)];
            }
            number_tiles[i].Set_Tile_Value(chosen_answer);
        }
        ball.Respawn();
        Set_Answer();
    }