예제 #1
0
    // Use this for initialization
    void Start()
    {
        main_script        = GameObject.Find("Main Background").GetComponent <Main_Script>();
        main_screen_script = GameObject.Find("Main Screen").GetComponent <Main_screen_Script>();

        popup_text = GameObject.Find("Popup_text");

        OK_button  = GameObject.Find("Popup_OK");
        YES_button = GameObject.Find("Popup_YES");
        NO_button  = GameObject.Find("Popup_NO");
        OK_button.GetComponent <Button>().onClick.AddListener(OK_click);
        YES_button.GetComponent <Button>().onClick.AddListener(YES_click);
        NO_button.GetComponent <Button>().onClick.AddListener(NO_click);


        dropdown       = GameObject.Find("Popup_dropdown");
        OK_drop_button = GameObject.Find("Popup_drop_OK");
    }
예제 #2
0
    // Use this for initialization
    void Start()
    {
        main_screen_script = GameObject.Find("Main Screen").GetComponent <Main_screen_Script>();

        GameObject.Find("Plus age Button").GetComponent <Button>().onClick.AddListener(Plus_Age);
        GameObject.Find("EL up Button").GetComponent <Button>().onClick.AddListener(Text_Up);
        GameObject.Find("EL down Button").GetComponent <Button>().onClick.AddListener(Text_Down);

        mark         = GameObject.Find("Mark_debug").GetComponent <Text>();
        intelligence = GameObject.Find("Intelligence_debug").GetComponent <Text>();


        string       line;
        StreamReader reader;
        TextAsset    reader_file = Resources.Load <TextAsset>("Education_places");

        if (reader_file != null)
        {
            using (reader = new StreamReader(new MemoryStream(reader_file.bytes)))
            {
                int i = 0;
                int g = 0;
                //-------------------------------------------------------
                while ((line = reader.ReadLine()) != null)
                {
                    education_places.Add(new Education_Place());
                    education_places[i].name            = line;
                    education_places[i].education_given = int.Parse(reader.ReadLine());
                    education_places[i].education_level = int.Parse(reader.ReadLine());
                    education_places[i].sphere          = reader.ReadLine();
                    education_places[i].months          = int.Parse(reader.ReadLine());
                    education_places[i].break_school    = int.Parse(reader.ReadLine());
                    g = 0;
                    if (education_places[i].education_given == 4)
                    {
                        g = 2;
                    }
                    for (int j = 0; j < g; ++j)
                    {
                        education_places[i].exams.Add(new Main_Exam());
                        string temp = reader.ReadLine();
                        for (int k = 0; k < temp.IndexOf("-"); ++k)
                        {
                            education_places[i].exams[j].name += temp[k];
                        }
                        temp = temp.Remove(0, temp.IndexOf("-") + 1);


                        education_places[i].exams[j].mark = int.Parse(temp);
                    }

                    g = 0;
                    if (education_places[i].education_given == 1)
                    {
                        g = 4;
                    }
                    else if (education_places[i].education_given == 2)
                    {
                        g = 4;
                    }
                    else if (education_places[i].education_given == 3)
                    {
                        g = 4;
                    }
                    else if (education_places[i].education_given == 4)
                    {
                        g = 4;
                    }
                    else
                    {
                        g = 0;
                    }
                    for (int j = 0; j < g; ++j)
                    {
                        education_places[i].schedule.Add(new Subject());
                        education_places[i].schedule[j].name = reader.ReadLine();
                    }
                    i++;
                }
                //-------------------------------------------------------
            }
        }



        protagonist = new Human(new Human(null, null, "father"), new Human(null, null, "mother"), "protagonist");
        main_family_list.Add(protagonist);
        main_family_list.Add(protagonist.father);
        main_family_list.Add(protagonist.mother);

        main_screen_script.New_Age(protagonist.age.years, protagonist.age.month);
        main_screen_script.Add_TextCode("2", protagonist.mother);
    }