void select_br(GameObject obj) { int hard = int.Parse(obj.name.Substring(1)); s_t_br t_br = game_data._instance.get_t_br(hard); if (hard > mario._instance.m_self.br_max + 1) { mario._instance.show_tip(t_br.unlock); return; } m_bhard = hard; m_br_select.transform.localPosition = obj.transform.localPosition; m_br_bk.GetComponent <UITexture>().mainTexture = m_br_texs[m_bhard - 1]; m_br_text.GetComponent <UILabel>().text = t_br.desc; }
void show_br() { if (mario._instance.m_self.br_start == 1) { m_br_start.SetActive(false); m_br_continue.SetActive(true); m_br_jd.SetActive(true); m_br_select_panel.SetActive(false); m_br_life.GetComponent <UILabel>().text = "x " + mario._instance.m_self.br_life.ToString(); m_br_index.GetComponent <UILabel>().text = (mario._instance.m_self.br_index + 1).ToString() + "/8"; m_br_bk.GetComponent <UITexture>().mainTexture = m_br_texs[mario._instance.m_self.br_hard - 1]; s_t_br t_br = game_data._instance.get_t_br(mario._instance.m_self.br_hard); m_br_text.GetComponent <UILabel>().text = t_br.desc; } else { m_br_start.SetActive(true); m_br_continue.SetActive(false); m_br_jd.SetActive(false); m_br_select_panel.SetActive(true); m_br_bk.GetComponent <UITexture>().mainTexture = m_br_texs[0]; m_br_select.transform.localPosition = new Vector3(-140, 150, 0); m_bhard = 1; s_t_br t_br = game_data._instance.get_t_br(1); m_br_text.GetComponent <UILabel>().text = t_br.desc; for (int i = 0; i < m_br_locks.Count; ++i) { if (mario._instance.m_self.br_max + 1 >= i + 2) { m_br_locks[i].SetActive(false); } else { m_br_locks[i].SetActive(true); } } } }
void reset() { m_type = 0; if (mario._instance.m_self.br_hard > 2) { m_type = 1; } m_index = mario._instance.m_self.br_index; if (m_type == 0) { m_road1.SetActive(true); m_road2.SetActive(false); } else { m_road1.SetActive(false); m_road2.SetActive(true); } m_c2.transform.localPosition = m_roads[m_type].m_c2; m_life.GetComponent <UILabel>().text = "x " + mario._instance.m_self.br_life.ToString(); s_t_br t_br = game_data._instance.get_t_br(mario._instance.m_self.br_hard); m_jd.GetComponent <UILabel>().text = (mario._instance.m_self.br_index + 1).ToString() + "/" + t_br.num; }
void OnEnable() { m_num.GetComponent <UILabel> ().text = "x " + mario._instance.m_self.br_life.ToString(); m_touxiang.GetComponent <UISprite> ().spriteName = game_data._instance.get_t_touxiang(mario._instance.m_self.br_user_head); m_name.GetComponent <UILabel> ().text = mario._instance.m_self.br_user_name; m_gq.GetComponent <UISprite> ().spriteName = game_data._instance.get_t_guojia(mario._instance.m_self.br_user_country); m_map_name.GetComponent <UILabel> ().text = mario._instance.m_self.br_map_name; s_t_br t_br = game_data._instance.get_t_br(mario._instance.m_self.br_hard); m_jd.GetComponent <UILabel>().text = (mario._instance.m_self.br_index + 1).ToString() + "/" + t_br.num; this.gameObject.SetActive(true); if (mario._instance.m_start_type == 0) { start(); } else if (mario._instance.m_start_type == 1) { die(); } else { next(); } }
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(); }