public void reset(int rank, int map_id, protocol.game.map_point_rank msg) { m_map_id = map_id; m_msg = msg; m_rank.GetComponent <UILabel> ().text = rank.ToString(); m_name.GetComponent <UILabel> ().text = "[u]" + player.get_name(m_msg.user_id, m_msg.player_name, m_msg.visitor); s_t_exp t_exp = game_data._instance.get_t_exp(m_msg.player_level); m_level.GetComponent <UISprite> ().spriteName = t_exp.icon; m_level_text.GetComponent <UILabel>().text = m_msg.player_level.ToString(); m_time.GetComponent <UILabel> ().text = timer.get_game_time(m_msg.player_point); m_guojia.GetComponent <UISprite> ().spriteName = game_data._instance.get_t_guojia(m_msg.player_country); if (rank == 1) { m_rank_icon.GetComponent <UISprite>().spriteName = "hz_01"; } else if (rank == 2) { m_rank_icon.GetComponent <UISprite>().spriteName = "hz_02"; } else if (rank == 3) { m_rank_icon.GetComponent <UISprite>().spriteName = "hz_03"; } else { m_rank_icon.GetComponent <UISprite>().spriteName = ""; } if (m_msg.user_id == mario._instance.m_self.userid) { this.GetComponent <UISprite>().spriteName = "phb_list_frame001"; } }
public void reset(protocol.game.smsg_view_map_point_rank msg, int id) { m_l1.SetActive(true); mario._instance.remove_child(m_ph_view); for (int i = 0; i < msg.ranks.Count; ++i) { protocol.game.map_point_rank mpr = msg.ranks[i]; GameObject obj = (GameObject)Instantiate(m_ph_sub); obj.transform.parent = m_ph_view.transform; obj.transform.localPosition = new Vector3(0, 170 - i * 75, 0); obj.transform.localScale = new Vector3(1, 1, 1); obj.GetComponent <paihang_sub>().reset(i + 1, id, mpr); obj.SetActive(true); } m_ph_view.GetComponent <UIScrollView>().ResetPosition(); }