public void ItemButtonClick(ChooseItemEntry entry) { List<ChooseItemEntry> temp_list = null; bool b_set_section = false; if(_current_page == page_type.page_type_official && _officil_page_type == offcil_page_type.offcil_page_type_section) { b_set_section = true; temp_list = _officil_items; } else { temp_list = _items; } foreach (ChooseItemEntry temp in temp_list) { if (temp == entry) { temp.select(); _current_map_index = temp._map_index; if (b_set_section) { _chapter_id = (int)_current_map_index; } } else { temp.unselect(); } } if (_current_page == page_type.page_type_official) { if (_officil_page_type == offcil_page_type.offcil_page_type_section) { EnterToContainer(containers_type_panel.containers_type_panel_main); _officil_page_type = offcil_page_type.offcil_page_type_number; List<CrashMapData> list_maps = global_instance.Instance._officilMapManager.getChapterMaps((int)_current_map_index); bool is_admin = false; if (global_instance.Instance._player.isadmin ()) { is_admin = true; } _edit_obj_button.SetActive(is_admin); _create_obj_button.SetActive(is_admin); _play_obj_button.SetActive(true); _edit_section_obj_button.SetActive(false); _Back_obj_button.SetActive(true); foreach (ChooseItemEntry entry_temp in _officil_items) { entry_temp.transform.SetParent(null); Destroy(entry_temp.gameObject); } _officil_items.Clear(); foreach(CrashMapData entry_map in list_maps) { addItem(entry_map, false); } _current_map_index = 0; } } }
public void refrashCurrentPage(page_type page) { _current_map_index = 0; ClearItems(); _edit_section_obj_button.SetActive(false); switch (page) { case page_type.page_type_self_complete: { EnterSelfComplete(); } break; case page_type.page_type_self_incomplete: { EnterSelfIncomplete(); } break; case page_type.page_type_rank: { } break; case page_type.page_type_official: { _officil_page_type = offcil_page_type.offcil_page_type_section; SelfButtonChange(false); _Back_obj_button.SetActive(false); if (global_instance.Instance._player.isadmin ()) { _edit_section_obj_button.SetActive(true); } Dictionary<int, string> officil_section_names = global_instance.Instance._officilMapManager.getChapterNames(); foreach (KeyValuePair<int, string> key_temp in officil_section_names) { ChooseItemEntry temp = CreateItemEntry(); temp._txt_1.text = key_temp.Key.ToString(); temp._txt_2.text = key_temp.Value; temp._map_index = (ulong)key_temp.Key; temp.transform.parent = _officil_items_container.transform; temp.gameObject.SetActive(true); _officil_items.Add(temp); } } break; } }