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); } } }
public void Calculate_graphs(Engine_options options, int graph_num) { List <int> label_x = options.Get_list_rpm(); interpolation = options.interpolation; interpolated_x = Calculation_formulas.Interpolated_x( options.Get_list_rpm(), interpolation); switch (graph_num) { case 0: Moment_graphs(label_x, options.Get_list_moment()); break; case 1: Consumption_graphs(label_x, options.Get_list_consumption()); break; case 2: Moment_graphs(label_x, options.Get_list_moment()); Consumption_graphs(label_x, options.Get_list_consumption()); break; } Moment_and_consumption_graph(label_x, options.Get_list_moment(), options.Get_list_consumption()); Graph_change(dropdown.value); }
// обновить график по номеру (0-момента, мощности, 1-расхода, удельного расхода, 2 - обновить все) private void Graph_update(int graph_num) { Engine_options graph_options = new Engine_options("", ""); graph_options.Set_rpms(table.GetItems()); graph_options.interpolation = (int)input_inter.value; if (graph_options.rpms.Count != 0) { graph_options.rpms.Sort((a, b) => a.rpm.CompareTo(b.rpm)); graph.Calculate_graphs(graph_options, graph_num); } }
public void Load_options(Engine_options loaded_options) // получить загруженные данные { options = loaded_options; }
public void Set_profile(Engine_options profile) { options = profile; Load(); }