Beispiel #1
0
    /// <summary>
    /// 点击事件
    /// </summary>
    /// <param name="eventType"></param>
    /// <param name="data"></param>
    /// <param name="param"></param>
    private void OnMyTeamGridEventDlg(UIEventType eventType, object data, object param)
    {
        if (eventType == UIEventType.Click)
        {
            UIMyTeamGrid grid = data as UIMyTeamGrid;
            if (grid == null)
            {
                return;
            }

            uint btnIndex = (uint)param;
            //队员操作界面
            if (btnIndex == 1)
            {
                Vector3        position       = grid.transform.position;
                MyTeamGridData myTeamGridData = new MyTeamGridData {
                    teamMemberInfo = grid.teamMemberInfo, pos = position
                };
                DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.TeamMemberBtnPanel, data: myTeamGridData);
            }
            //打开添加队员界面
            if (btnIndex == 2)
            {
                DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.TeamInvitePanel);//打开添加队员界面
            }
        }
    }
Beispiel #2
0
    protected override void OnPrepareShow(object data)
    {
        base.OnPrepareShow(data);
        this.myTeamGridData = data as MyTeamGridData;

        if (this.myTeamGridData != null)
        {
            m_trans_content.position = this.myTeamGridData.pos;
        }
        else
        {
            Engine.Utility.Log.Error("好友数据MyTeamGridData 为null  !!!");
        }

        uint MainPlayerID = ClientGlobal.Instance().MainPlayer.GetID();

        if (IsLeader(MainPlayerID))   //本人是队长   有5个按钮
        {
            m_sprite_bg.width  = 166;
            m_sprite_bg.height = 260;
            m_btn_btn_sendmessage.gameObject.SetActive(true);
            m_btn_btn_lookmessage.gameObject.SetActive(true);
            m_btn_btn_addfriend.gameObject.SetActive(true);
            m_btn_btn_giveleader.gameObject.SetActive(true);
            m_btn_btn_kickedoutteam.gameObject.SetActive(true);
        }
        else                               //本人不是队长,3个按钮
        {
            m_sprite_bg.width  = 166;
            m_sprite_bg.height = 160;
            m_btn_btn_sendmessage.gameObject.SetActive(true);
            m_btn_btn_lookmessage.gameObject.SetActive(true);
            m_btn_btn_addfriend.gameObject.SetActive(true);
            m_btn_btn_giveleader.gameObject.SetActive(false);
            m_btn_btn_kickedoutteam.gameObject.SetActive(false);
        }
    }