void reset_big() { mario._instance.remove_child(m_left_view_big); m_left_view_big.GetComponent <UIScrollView> ().ResetPosition(); int num = 0; foreach (KeyValuePair <int, s_t_view_title> kv in game_data._instance.m_t_view_title) { s_t_view_title vt = kv.Value; bool flag = false; if (vt.id == 200) { if (mario._instance.m_self.testify != 0) { continue; } } else if (vt.id == 201) { if (mario._instance.m_self.testify != 1) { continue; } } else if (vt.id == 202) { if (mario._instance.m_self.testify != 2) { continue; } } else if (vt.id == 203) { if (mario._instance.m_self.testify != 3) { continue; } } GameObject obj = (GameObject)Instantiate(m_play_select_big); obj.name = "big_sub"; obj.transform.parent = m_left_view_big.transform; obj.transform.localPosition = new Vector3(-300, 182 - 85 * num, 0); obj.transform.localScale = new Vector3(1, 1, 1); obj.transform.FindChild("icon").GetComponent <UISprite>().spriteName = vt.icon; obj.GetComponent <UIButtonMessage>().target = this.gameObject; if (vt.id >= 200) { obj.GetComponent <play_select_big>().m_clevel = game_data._instance.get_zm(vt.id - 199); } utils.add_pos_anim(obj, 0.5f, new Vector3(300, 0, 0), num * 0.05f); obj.GetComponent <play_select_big>().reset(vt); obj.SetActive(true); num++; } }
public void reset(s_t_view_title t_view_title) { m_type = t_view_title.id; m_icon.GetComponent <UISprite> ().spriteName = t_view_title.icon; m_title.GetComponent <UILabel> ().text = t_view_title.name; if (mario._instance.m_self.guide == 200 && m_type == 200) { m_shou.SetActive(true); } else { m_shou.SetActive(false); } }
void click(GameObject obj) { if (mario._instance.m_self.guide == 200) { if (obj.name != "big_sub") { mario._instance.show_tip(game_data._instance.get_language_string("play_select_gui_jxbs")); return; } int id = obj.GetComponent <play_select_big>().m_type; if (id != 200) { mario._instance.show_tip(game_data._instance.get_language_string("play_select_gui_jxbs")); return; } } if (mario._instance.m_self.guide == 201 && obj.name != "play") { mario._instance.show_tip(game_data._instance.get_language_string("play_select_gui_jxpl")); return; } if (obj.name == "close") { mario._instance.change_state(e_game_state.egs_login, 1, delegate() { Object.Destroy(this.gameObject); }); } if (obj.name == "big_sub") { if (m_lan == 0) { int id = obj.GetComponent <play_select_big>().m_type; if (id >= 200) { int clevel = obj.GetComponent <play_select_big>().m_clevel; if (clevel > mario._instance.m_self.level) { s_t_view_title t_vt = game_data._instance.get_t_view_title(id); string s = string.Format(game_data._instance.get_language_string("play_select_gui_ddjv"), clevel, t_vt.name); mario._instance.show_tip(s); return; } if (mario._instance.m_self.guide == 200) { obj.GetComponent <play_select_big>().hide_shou(); mario._instance.m_self.guide = 201; } protocol.game.cmsg_view_comment msg = new protocol.game.cmsg_view_comment(); msg.id = mario._instance.m_self.mapid; net_http._instance.send_msg <protocol.game.cmsg_view_comment>(opclient_t.OPCODE_VIEW_COMMENT, msg); } else if (id == 1) { change_first(true); } else if (id == 2) { protocol.game.cmsg_mission_view msg = new protocol.game.cmsg_mission_view(); net_http._instance.send_msg <protocol.game.cmsg_mission_view>(opclient_t.OPCODE_MISSION_VIEW, msg); } } } if (obj.name == "first_sub") { if (m_lan == 1) { m_page_type = obj.GetComponent <play_select_sub>().m_type; m_page_up = 0; m_page_down = 0; m_page_fx = 0; protocol.game.cmsg_view_map msg = new protocol.game.cmsg_view_map(); msg.index = 0; msg.type = m_page_type; msg.ver = game_data.m_self_map_ver; net_http._instance.send_msg <protocol.game.cmsg_view_map>(opclient_t.OPCODE_VIEW_MAP, msg); } } if (obj.name == "return") { if (m_lan == 2) { m_page_type = -1; change_first(false); } else if (m_lan == 1) { m_page_type = -1; change_big(); } else { mario._instance.change_state(e_game_state.egs_login, 1, delegate() { Object.Destroy(this.gameObject); }); } } if (obj.name == "small_sub") { protocol.game.map_show ms = obj.GetComponent <play_select_sub1>().m_ms; protocol.game.cmsg_view_comment msg = new protocol.game.cmsg_view_comment(); msg.id = ms.id; net_http._instance.send_msg <protocol.game.cmsg_view_comment>(opclient_t.OPCODE_VIEW_COMMENT, msg); } if (obj.name == "play") { m_id = m_mi.id; protocol.game.cmsg_play_map msg = new protocol.game.cmsg_play_map(); msg.id = m_id; net_http._instance.send_msg <protocol.game.cmsg_play_map>(opclient_t.OPCODE_PLAY_MAP, msg); } if (obj.name == "search") { if (m_lan == 0) { mario._instance.show_tip(game_data._instance.get_language_string("play_select_gui_zxsc")); return; } m_search.SetActive(true); m_search_text.GetComponent <UIInput>().value = ""; } if (obj.name == "search_ok") { string name = m_search_text.GetComponent <UIInput>().value; if (name == "") { mario._instance.show_tip(game_data._instance.get_language_string("play_select_gui_gjzk")); return; } m_page_type = -1; protocol.game.cmsg_search_map msg = new protocol.game.cmsg_search_map(); msg.name = name; net_http._instance.send_msg <protocol.game.cmsg_search_map>(opclient_t.OPCODE_SEARCH_MAP, msg); } if (obj.name == "search_close") { m_search.GetComponent <ui_show_anim>().hide_ui(); } if (obj.name == "shc") { protocol.game.cmsg_favorite_map msg = new protocol.game.cmsg_favorite_map(); msg.id = m_mi.id; net_http._instance.send_msg <protocol.game.cmsg_favorite_map>(opclient_t.OPCODE_FAVORITE_MAP, msg); } if (obj.name == "pl") { m_pinglun.SetActive(true); m_pinglun_text.GetComponent <UIInput>().value = ""; } if (obj.name == "pinglun_ok") { string text = m_pinglun_text.GetComponent <UIInput>().value; if (text == "") { mario._instance.show_tip(game_data._instance.get_language_string("play_select_gui_plwk")); return; } protocol.game.cmsg_comment msg = new protocol.game.cmsg_comment(); msg.id = m_mi.id; msg.text = text; net_http._instance.send_msg <protocol.game.cmsg_comment>(opclient_t.OPCODE_COMMENT, msg); } if (obj.name == "pinglun_close") { m_pinglun.GetComponent <ui_show_anim>().hide_ui(); } if (obj.name == "ph") { protocol.game.cmsg_view_map_point_rank msg = new protocol.game.cmsg_view_map_point_rank(); msg.map_id = m_mi.id; net_http._instance.send_msg <protocol.game.cmsg_view_map_point_rank>(opclient_t.OPCODE_VIEW_MAP_POINT_RANK, msg); } if (obj.name == "touxiang") { look_player(m_mi.owner_id); } if (obj.name == "br_start") { protocol.game.cmsg_mission_start msg = new protocol.game.cmsg_mission_start(); msg.hard = m_bhard; net_http._instance.send_msg <protocol.game.cmsg_mission_start>(opclient_t.OPCODE_MISSION_START, msg); } if (obj.name == "br_continue") { protocol.game.cmsg_mission_continue msg = new protocol.game.cmsg_mission_continue(); net_http._instance.send_msg <protocol.game.cmsg_mission_continue>(opclient_t.OPCODE_MISSION_CONTINUE, msg); } if (obj.name == "download") { s_message mes = new s_message(); mes.m_type = "player_select_gui_download"; mario._instance.show_double_dialog_box(game_data._instance.get_language_string("play_select_gui_dself"), mes); } if (obj.name == "br_drop") { s_message mes = new s_message(); mes.m_type = "player_select_gui_br_drop"; mario._instance.show_double_dialog_box(game_data._instance.get_language_string("play_select_gui_br_drop"), mes); } }
public void init() { load_native(); dbc tdbc = new dbc(); tdbc.load_txt("t_language"); for (int i = 0; i < tdbc.get_y(); ++i) { s_t_language t_l = new s_t_language(); t_l.id = tdbc.get(0, i); t_l.zw = tdbc.get(1, i); t_l.ew = tdbc.get(2, i); m_t_language [t_l.id] = t_l; } tdbc.load_txt("t_unit"); for (int i = 0; i < tdbc.get_y(); ++i) { s_t_unit t_unit = new s_t_unit(); t_unit.id = int.Parse(tdbc.get(0, i)); t_unit.name = tdbc.get(1, i); t_unit.icon = tdbc.get(2, i); t_unit.res = tdbc.get(3, i); t_unit.yc = int.Parse(tdbc.get(4, i)); t_unit.kfg = int.Parse(tdbc.get(5, i)); t_unit.is_static = int.Parse(tdbc.get(6, i)); t_unit.fwt = int.Parse(tdbc.get(7, i)); t_unit.review = int.Parse(tdbc.get(8, i)); t_unit.is_sw = int.Parse(tdbc.get(9, i)); t_unit.max_num = int.Parse(tdbc.get(10, i)); m_t_unit [t_unit.id] = t_unit; if (t_unit.yc == 0) { m_unit_sites.Add(t_unit.id); m_unit_num++; } } tdbc.load_txt("t_error"); for (int i = 0; i < tdbc.get_y(); ++i) { int id = int.Parse(tdbc.get(0, i)); string des = get_language_string(tdbc.get(1, i)); m_t_error [id] = des; } tdbc.load_txt("t_view_map"); for (int i = 0; i < tdbc.get_y(); ++i) { s_t_view_map t_view = new s_t_view_map(); t_view.id = int.Parse(tdbc.get(0, i)); t_view.name = get_language_string(tdbc.get(1, i)); t_view.icon = tdbc.get(2, i); m_t_view_map [t_view.id] = t_view; } tdbc.load_txt("t_view_title"); for (int i = 0; i < tdbc.get_y(); ++i) { s_t_view_title t_view = new s_t_view_title(); t_view.id = int.Parse(tdbc.get(0, i)); t_view.name = get_language_string(tdbc.get(1, i)); t_view.icon = tdbc.get(2, i); m_t_view_title [t_view.id] = t_view; } tdbc.load_txt("t_touxiang"); for (int i = 0; i < tdbc.get_y(); ++i) { int id = int.Parse(tdbc.get(0, i)); string icon = tdbc.get(1, i); m_t_touxiang [id] = icon; } tdbc.load_txt("t_guojia"); for (int i = 0; i < tdbc.get_y(); ++i) { string code = tdbc.get(0, i); string icon = tdbc.get(2, i); m_t_guojia [code] = icon; } tdbc.load_txt("t_exp"); int zm = 0; for (int i = 0; i < tdbc.get_y(); ++i) { s_t_exp t_exp = new s_t_exp(); t_exp.level = int.Parse(tdbc.get(0, i)); t_exp.exp = int.Parse(tdbc.get(1, i)); t_exp.zm = int.Parse(tdbc.get(2, i)); t_exp.icon = tdbc.get(3, i); t_exp.max_exp = int.Parse(tdbc.get(4, i)); m_t_exp [t_exp.level] = t_exp; if (t_exp.zm != zm) { zm = t_exp.zm; m_t_zm [zm] = t_exp.level; } } tdbc.load_txt("t_job_exp"); for (int i = 0; i < tdbc.get_y(); ++i) { s_t_job_exp t_job_exp = new s_t_job_exp(); t_job_exp.level = int.Parse(tdbc.get(0, i)); t_job_exp.exp = int.Parse(tdbc.get(1, i)); m_t_job_exp [t_job_exp.level] = t_job_exp; } tdbc.load_txt("t_shop"); for (int i = 0; i < tdbc.get_y(); ++i) { s_t_shop t_shop = new s_t_shop(); t_shop.id = int.Parse(tdbc.get(0, i)); t_shop.slot = int.Parse(tdbc.get(1, i)); t_shop.name = get_language_string(tdbc.get(2, i)); t_shop.type = int.Parse(tdbc.get(3, i)); t_shop.price = int.Parse(tdbc.get(4, i)); t_shop.price_my = float.Parse(tdbc.get(5, i)); t_shop.icon = tdbc.get(6, i); t_shop.db = tdbc.get(7, i); t_shop.def = int.Parse(tdbc.get(8, i)); t_shop.code = tdbc.get(9, i); t_shop.desc = get_language_string(tdbc.get(10, i)); m_t_shop [t_shop.id] = t_shop; } tdbc.load_txt("t_fg"); for (int i = 0; i < tdbc.get_y(); ++i) { s_t_fg t_fg = new s_t_fg(); t_fg.id = int.Parse(tdbc.get(0, i)); t_fg.name = get_language_string(tdbc.get(1, i)); t_fg.tj = int.Parse(tdbc.get(2, i)); t_fg.desc = get_language_string(tdbc.get(3, i)); t_fg.music = tdbc.get(4, i); m_t_fg [t_fg.id] = t_fg; m_fg_num++; } tdbc.load_txt("t_map"); for (int i = 0; i < tdbc.get_y(); ++i) { int id = int.Parse(tdbc.get(0, i)); m_t_map.Add(id); } tdbc.load_txt("t_br"); for (int i = 0; i < tdbc.get_y(); ++i) { s_t_br t_br = new s_t_br(); t_br.id = int.Parse(tdbc.get(0, i)); t_br.name = get_language_string(tdbc.get(2, i)); t_br.num = int.Parse(tdbc.get(3, i)); t_br.desc = get_language_string(tdbc.get(4, i)); t_br.unlock = get_language_string(tdbc.get(6, i)); m_t_br.Add(t_br); } tdbc.load_txt("t_key"); for (int i = 0; i < tdbc.get_y(); ++i) { s_t_key t_key = new s_t_key(); t_key.code = int.Parse(tdbc.get(0, i)); t_key.name = tdbc.get(1, i); m_t_key.Add(t_key.code, t_key); } new_mission(); if (Application.isEditor) { #if STEAM m_channel = "win_steam"; #else m_channel = ""; #endif } else { #if UNITY_ANDROID LJSDK._instance.init_channel(); m_channel = LJSDK._instance.m_channel; #elif UNITY_IPHONE m_channel = "IOS_yymoon"; #elif UNITY_WEBPLAYER LJSDK._instance.init_channel(); return; #elif UNITY_STANDALONE_WIN #if STEAM m_channel = "win_steam"; #else m_channel = "win_yymoon"; #endif #else m_channel = ""; #endif } init_pt_ver(); }