コード例 #1
0
ファイル: paihang_gui.cs プロジェクト: dqchess/mario
 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();
 }
コード例 #2
0
ファイル: player_select_gui.cs プロジェクト: dqchess/mario
    public void net_message(s_net_message message)
    {
        if (message.m_opcode == opclient_t.OPCODE_VIEW_MAP)
        {
            protocol.game.smsg_view_map _msg = net_http._instance.parse_packet <protocol.game.smsg_view_map> (message.m_byte);
            m_max_page = _msg.page;
            if (m_page_fx == 0)
            {
                clear_second();
            }
            add_second(_msg, m_page_fx);
            change_second();
        }
        if (message.m_opcode == opclient_t.OPCODE_VIEW_COMMENT)
        {
            protocol.game.smsg_view_comment _msg = net_http._instance.parse_packet <protocol.game.smsg_view_comment> (message.m_byte);
            show_map(_msg.infos);
            reset_pinlun(_msg.comments);
            m_right_view.GetComponent <UIScrollView>().ResetPosition();
            for (int i = 0; i < m_second.Count; ++i)
            {
                if (m_second[i].GetComponent <play_select_sub1>().m_ms.id == _msg.infos.id)
                {
                    m_second[i].GetComponent <play_select_sub1>().reset(_msg.infos.finish, _msg.infos.pas, _msg.infos.amount, _msg.infos.like);
                }
            }
            mario._instance.m_self.set_per(_msg.infos.head, _msg.infos.country, _msg.infos.owner_name, _msg.infos.name);
        }
        if (message.m_opcode == opclient_t.OPCODE_PLAY_MAP)
        {
            if (mario._instance.m_self.guide == 201)
            {
                mario._instance.m_self.guide = 202;
            }
            if (message.m_res == -1)
            {
                mario._instance.show_tip(game_data._instance.get_language_string("play_select_gui_tlbz"));
                protocol.game.msg_life_error _msg1 = net_http._instance.parse_packet <protocol.game.msg_life_error> (message.m_byte);
                mario._instance.m_self.set_reset_time(_msg1.server_time, _msg1.life_time);
                return;
            }
            protocol.game.smsg_play_map _msg = net_http._instance.parse_packet <protocol.game.smsg_play_map> (message.m_byte);
            mario_tool._instance.onRaid(m_id.ToString(), 1);
            bool flag = game_data._instance.load_mission(m_id, _msg.map_data, _msg.x, _msg.y);
            if (!flag)
            {
                return;
            }
            mario._instance.change_state(e_game_state.egs_play, 2, delegate()
            {
                if (this.gameObject.activeSelf)
                {
                    this.gameObject.SetActive(false);
                }
                else
                {
                    mario._instance.hide_clear_gui();
                }
            });
        }
        if (message.m_opcode == opclient_t.OPCODE_FAVORITE_MAP)
        {
            protocol.game.smsg_favorite_map _msg = net_http._instance.parse_packet <protocol.game.smsg_favorite_map> (message.m_byte);
            m_mi.favorite = _msg.num;
            m_mi.collect  = 1 - m_mi.collect;
            show_map(m_mi);
        }
        if (message.m_opcode == opclient_t.OPCODE_COMMENT)
        {
            mario._instance.show_tip(game_data._instance.get_language_string("play_select_gui_fbpl"));
            m_pinglun.GetComponent <ui_show_anim>().hide_ui();
            protocol.game.smsg_comment _msg = net_http._instance.parse_packet <protocol.game.smsg_comment> (message.m_byte);
            m_comments.Insert(0, _msg.comment);
            if (m_comments.Count > 10)
            {
                m_comments.RemoveAt(m_comments.Count - 1);
            }
            reset_pinlun(m_comments);
        }
        if (message.m_opcode == opclient_t.OPCODE_SEARCH_MAP)
        {
            m_search.GetComponent <ui_show_anim>().hide_ui();
            protocol.game.smsg_view_map _msg = net_http._instance.parse_packet <protocol.game.smsg_view_map> (message.m_byte);
            if (_msg.infos.Count == 0)
            {
                mario._instance.show_tip(game_data._instance.get_language_string("play_select_gui_mzdt"));
                return;
            }
            clear_second();
            add_second(_msg, 0);
            change_second();
        }
        if (message.m_opcode == opclient_t.OPCODE_VIEW_MAP_POINT_RANK)
        {
            protocol.game.smsg_view_map_point_rank _msg = net_http._instance.parse_packet <protocol.game.smsg_view_map_point_rank> (message.m_byte);
            mario._instance.show_paihang_gui(_msg, m_mi.id);
        }
        if (message.m_opcode == opclient_t.OPCODE_VIEW_VIDEO)
        {
            protocol.game.smsg_view_video _msg = net_http._instance.parse_packet <protocol.game.smsg_view_video> (message.m_byte);
            bool flag = game_data._instance.load_mission(m_mi.id, _msg.map_data, null, null);
            if (!flag)
            {
                return;
            }
            game_data._instance.load_inputs(_msg.video_data);
            mario._instance.change_state(e_game_state.egs_review, 2, delegate() { this.gameObject.SetActive(false); mario._instance.hide_paihang_gui(); });
        }
        if (message.m_opcode == opclient_t.OPCODE_VIEW_PLAYER)
        {
            protocol.game.smsg_view_player _msg = net_http._instance.parse_packet <protocol.game.smsg_view_player> (message.m_byte);
            mario._instance.show_player_gui(_msg);
        }
        if (message.m_opcode == opclient_t.OPCODE_MISSION_VIEW)
        {
            protocol.game.smsg_mission_view _msg = net_http._instance.parse_packet <protocol.game.smsg_mission_view> (message.m_byte);
            mario._instance.m_self.br_life  = _msg.life;
            mario._instance.m_self.br_index = _msg.index;
            mario._instance.m_self.br_start = _msg.start;
            mario._instance.m_self.br_hard  = _msg.hard;
            mario._instance.m_self.br_max   = _msg.br_max;

            m_back.SetActive(false);
            m_back1.SetActive(false);
            m_back2.SetActive(true);
            show_br();
        }
        if (message.m_opcode == opclient_t.OPCODE_MISSION_START || message.m_opcode == opclient_t.OPCODE_MISSION_CONTINUE)
        {
            if (message.m_opcode == opclient_t.OPCODE_MISSION_START)
            {
                mario._instance.m_self.br_index = 0;
                mario._instance.m_self.br_life  = 100;
                mario._instance.m_self.br_start = 1;
                mario._instance.m_self.br_hard  = m_bhard;
                mario._instance.m_start_type    = 0;
            }
            else
            {
                mario._instance.m_start_type = 2;
            }
            protocol.game.smsg_mission_play _msg = net_http._instance.parse_packet <protocol.game.smsg_mission_play> (message.m_byte);
            mario._instance.m_self.set_br(_msg.user_head, _msg.user_country, _msg.user_name, _msg.map_name);
            game_data._instance.load_mission(-1, _msg.map_data, _msg.x, _msg.y);
            mario._instance.change_state(e_game_state.egs_br_road, 2, delegate() { this.gameObject.SetActive(false); });
        }
        if (message.m_opcode == opclient_t.OPCODE_DOWNLOAD_MAP)
        {
            mario._instance.m_self.download_num++;
            mario._instance.show_tip(game_data._instance.get_language_string("play_select_gui_dlok"));
        }
        if (message.m_opcode == opclient_t.OPCODE_MISSION_DROP)
        {
            mario._instance.m_self.br_start = 0;
            show_br();
        }
    }
コード例 #3
0
 public void show_paihang_gui(protocol.game.smsg_view_map_point_rank msg, int id)
 {
     m_paihang_gui.SetActive(true);
     m_paihang_gui.GetComponent <paihang_gui> ().reset(msg, id);
 }