Beispiel #1
0
    private void Awake()
    {
        Transform options_empty = transform.Find("Options_empty");

        options_empty.Find("Button").GetComponent <Button>().onClick.AddListener(Main_menu);
        Engine_options options = File_controller.Load_one_profile();

        if (options == null)
        {
            options_empty.gameObject.SetActive(true);
        }
        else
        {
            if (options.rpms.Count == 0)
            {
                options_empty.gameObject.SetActive(true);
            }
            else
            {
                stand_controller.Load_options(options);
                fuel_controller.Load_options(options.fuel_amount);
                menu.Load_options(options.hints, options.profile_show, options.car_name, options.engine_name);
            }
        }
    }
Beispiel #2
0
    private void OnDestroy()
    {
        if (current_profile_index == -1)
        {
            current_profile_index = 0;
        }

        if (options.Count > 1)
        {
            options.Insert(0, options[current_profile_index]);
            options.RemoveAt(current_profile_index + 1);
        }
        File_controller.Save_engine_options(options);
    }
Beispiel #3
0
 private void Profiles_load()
 {
     options = File_controller.Load_engine_options();
     if (options != null)
     {
         foreach (Engine_options item in options)
         {
             Item_add(item.car_name + "-" + item.engine_name);
         }
         Profile_clicked(true, 0); // выбрать первый профиль как основной
         items_list[0].isOn = true;
     }
     else
     {
         options = new List <Engine_options>();
     }
 }