void onBtnRemoveTeam(GameObject go)
 {
     TeamProxy.getInstance().SendKickOut(cid);
 }
示例#2
0
        private void onTab(int tag)
        {
            tabIdx = tag;
            for (int i = 0; i < tab.Count; i++)
            {
                tab[i].GetComponent <Button>().interactable = true;
            }
            tab[tabIdx].GetComponent <Button>().interactable = false;
            Clear_con();


            ids     = tabIdx;
            now_tab = 1;
            switch (tabIdx)
            {
            case 0:
                //服务器发请求,组队目的为:自定义,所有队伍数据
                TeamProxy.getInstance().SendGetPageTeam(0, begin_index, end_index);
                //GetTeam_info(/*0*/);
                limited_dj = Set_Limited_dj(5);
                now_Tpid   = 0;
                break;

            case 1:
                //服务器发请求,组队目的为:挂机,所有队伍数据
                TeamProxy.getInstance().SendGetPageTeam(1, begin_index, end_index);
                //GetTeam_info(/*1*/);
                limited_dj = Set_Limited_dj(4);

                now_Tpid = 1;
                break;

            case 2:
                //服务器发请求,组队目的为:魔物猎人,所有队伍数据
                TeamProxy.getInstance().SendGetPageTeam(2, begin_index, end_index);
                //GetTeam_info(/*2*/);
                limited_dj = Set_Limited_dj(3);
                now_Tpid   = 2;
                break;

            case 3:
                //组队副本墓穴
                TeamProxy.getInstance().SendGetPageTeam(108, begin_index, end_index);
                //GetTeam_info(/*108*/);
                limited_dj = Set_Limited_dj(1);
                now_Tpid   = 108;
                break;

            case 4:
                //兽灵秘境
                TeamProxy.getInstance().SendGetPageTeam(105, begin_index, end_index);
                //GetTeam_info(/*105*/);
                now_Tpid   = 105;
                limited_dj = Set_Limited_dj(2);
                break;

            default:
                break;
            }
            RefreshChangeTxt();
        }
 void onTogAgreeOtherApplyClick(bool b)
 {
     TeamProxy.getInstance().SendEditorInfoDirJoin(b);
 }
        //播放技能朝向的刷新
        static public BaseRole RefreshLockRoleTransform(BaseRole LockRole)
        {
            if (LockRole is MonsterRole)
            {
                return(LockRole);
            }
            if (LockRole.isDead || LockRole == null)
            {
                return(null);
            }
            switch (PlayerModel.getInstance().now_pkState)
            {
            case 0:
                if (!LockRole.havefanjibuff)
                {
                    return(null);
                }
                else
                {
                    return(LockRole);
                }

            case 1:
                if (LockRole is ProfessionRole)
                {
                    if (OtherPlayerMgr._inst.m_mapOtherPlayer[LockRole.m_unIID].zhuan < 1)
                    {
                        return(null);
                    }
                }
                else
                {
                    return(LockRole);
                }
                break;

            case 2:
                bool canattack = false;
                if (LockRole is ProfessionRole)
                {
                    if (TeamProxy.getInstance().MyTeamData != null && TeamProxy.getInstance().MyTeamData.IsInMyTeam(LockRole.roleName))
                    {
                        canattack = false;
                    }
                    else
                    {
                        if (PlayerModel.getInstance().clanid == 0)
                        {
                            canattack = true;
                        }
                        else
                        {
                            canattack = PlayerModel.getInstance().clanid == LockRole.m_unLegionID ? false : true;
                        }
                    }
                }
                if (canattack)
                {
                    return(LockRole);
                }
                else
                {
                    return(null);
                }

            case 3:
                break;

            case 4:
                if (LockRole is ProfessionRole && LockRole.rednm > 0)
                {
                    return(LockRole);
                }
                return(null);
            }
            ;

            return(LockRole);
        }
        static public void RefreshShow(BaseRole LockRole, bool havepeopleLv = false, bool havpeoplerednam = false)
        {
            if (br == LockRole && PlayerModel.getInstance().now_pkState == pkstat && skin != null && havepeopleLv == false && havpeoplerednam == false)
            {
                return;
            }
            br   = LockRole;
            skin = SelfRole.s_LockFX.gameObject.GetComponent <MeshRenderer>();
            if (skin == null)
            {
                return;
            }

            if (LockRole is ProfessionRole)
            {
                if (OtherPlayerMgr._inst.m_mapOtherPlayer.ContainsKey(LockRole.m_unIID) && OtherPlayerMgr._inst.m_mapOtherPlayer[LockRole.m_unIID].zhuan < 1)
                {
                    skin.material.SetColor(EnumShader.SPI_TINT_COLOR, new Color(0f, 1f, 0f, 1f));
                    pkstat = PlayerModel.getInstance().now_pkState;
                    return;
                }
                if (!OtherPlayerMgr._inst.m_mapOtherPlayer.ContainsKey(LockRole.m_unIID))
                {//这里加下保护
                    SelfRole._inst.m_LockRole = null;
                }
            }
            else if (LockRole is MS0000)
            {
                if (((MS0000)LockRole).owner_cid == PlayerModel.getInstance().cid)
                {
                    skin.material.SetColor(EnumShader.SPI_TINT_COLOR, new Color(0f, 1f, 0f, 1f));
                }
                else
                {
                    skin.material.SetColor(EnumShader.SPI_TINT_COLOR, new Color(1f, 0f, 0f, 1f));
                }
                return;
            }
            else if (LockRole is MDC000)//镖车
            {
                if (((MDC000)LockRole).escort_name == A3_LegionModel.getInstance().myLegion.clname)
                {
                    skin.material.SetColor(EnumShader.SPI_TINT_COLOR, new Color(0f, 1f, 0f, 1f));
                }
                else
                {
                    if (((float)LockRole.curhp / (float)LockRole.maxHp * 100) <= 20)
                    {
                        skin.material.SetColor(EnumShader.SPI_TINT_COLOR, new Color(0f, 1f, 0f, 1f));
                        return;
                    }
                    skin.material.SetColor(EnumShader.SPI_TINT_COLOR, new Color(1f, 0f, 0f, 1f));
                }

                return;
            }
            else if (LockRole is MonsterRole)
            {
                skin.material.SetColor(EnumShader.SPI_TINT_COLOR, new Color(1f, 0f, 0f, 1f));
                pkstat = PlayerModel.getInstance().now_pkState;
                return;
            }
            pkstat = PlayerModel.getInstance().now_pkState;
            bool canattack = false;

            switch (PlayerModel.getInstance().now_pkState)
            {
            case 0:
                if (LockRole is ProfessionRole)
                {
                    if (!LockRole.havefanjibuff)
                    {
                        skin.material.SetColor(EnumShader.SPI_TINT_COLOR, new Color(0f, 1f, 0f, 1f));
                    }
                    else
                    {
                        skin.material.SetColor(EnumShader.SPI_TINT_COLOR, new Color(1f, 0f, 0f, 1f));
                    }
                }
                else if (LockRole == null)
                {
                    skin = null;
                }
                break;

            case 1:
                // cricle.startColor = new Color(1f, 0f, 0f, 1f);
                skin.material.SetColor(EnumShader.SPI_TINT_COLOR, new Color(1f, 0f, 0f, 1f));
                break;

            case 2:
                // debug.Log("我的军团id:" + PlayerModel.getInstance().clanid+"他的军团id:"+ LockRole.m_unLegionID);
                //debug.Log("是否同一队伍:" + TeamProxy.getInstance().MyTeamData.IsInMyTeam(LockRole.roleName)+"他的队伍id:"+ LockRole.m_unTeamID);
                if (LockRole == null)
                {
                    skin = null;
                    return;
                }
                else
                {
                    if (TeamProxy.getInstance().MyTeamData != null && TeamProxy.getInstance().MyTeamData.IsInMyTeam(LockRole.roleName))
                    {
                        canattack = false;
                    }
                    else
                    {
                        if (PlayerModel.getInstance().clanid == 0)
                        {
                            canattack = true;
                        }
                        else
                        {
                            canattack = PlayerModel.getInstance().clanid == LockRole.m_unLegionID ? false : true;
                        }
                    }
                }
                if (canattack)
                {
                    haveLockpeople = true;
                    skin.material.SetColor(EnumShader.SPI_TINT_COLOR, new Color(1f, 0f, 0f, 1f));
                }
                else
                {
                    haveLockpeople = false;
                    skin.material.SetColor(EnumShader.SPI_TINT_COLOR, new Color(0f, 1f, 0f, 1f));
                }

                break;

            case 3:

                break;

            case 4:
                if (LockRole == null)
                {
                    skin = null;
                }
                else
                {
                    if (LockRole.rednm > 0)
                    {
                        skin.material.SetColor(EnumShader.SPI_TINT_COLOR, new Color(1f, 0f, 0f, 1f));
                    }
                    else
                    {
                        skin.material.SetColor(EnumShader.SPI_TINT_COLOR, new Color(0f, 1f, 0f, 1f));
                    }
                }

                break;
            }
            ;
        }
 void onBtnRefreshClick(GameObject go)
 {
     TeamProxy.getInstance().SendGetMapTeam(begin_index, end_index);
 }
 void onBtnWatchClick(GameObject go)
 {
     worldmap.getmapid = false;
     TeamProxy.getInstance().SendWatchTeamInfo(tid);
     TeamProxy.WatchTeamId_limited = (uint)limited_dj;
 }
示例#8
0
        //===================================================================
        public void teamWorldPic()
        {
            ////ItemTeamMemberData ss = new ItemTeamMemberData();
            //ssg.Clear();

            if (TeamProxy.getInstance().MyTeamData != null)
            {
                getmapid = true;
                TeamProxy.getInstance().SendWatchTeamInfo(TeamProxy.getInstance().MyTeamData.teamId);
            }



            foreach (var v in goP22.GetComponentsInChildren <Transform>(true))
            {
                if (v.parent == goP22.transform)
                {
                    v.gameObject.SetActive(false);
                }
            }

            if (TeamProxy.getInstance().MyTeamData != null && TeamProxy.getInstance().teamMemberposData != null)
            {
                for (int i = 0; i < TeamProxy.getInstance().teamMemberposData.Count; i++)
                {
                    uint cc = TeamProxy.getInstance().teamMemberposData[i].mapId;


                    if (TeamProxy.getInstance().teamMemberposData[i].isCaptain)//
                    {
                        temp1 = goP22.transform.FindChild("signalteam").gameObject;
                        temp1.SetActive(true);
                        //sg = GameObject.Find("signalteam");
                        //temp1 = GameObject.Instantiate(sg) as GameObject;
                    }
                    else
                    {
                        temp1 = goP22.transform.FindChild("signal" + i).gameObject;
                        temp1.SetActive(true);
                        //sg = GameObject.Find("signal");
                        //temp1 = GameObject.Instantiate(sg) as GameObject;
                    }

                    //if (TeamProxy.getInstance().teamMemberposData[i].online == false)
                    //{
                    //    temp1 = goP22.transform.FindChild("signal_lx").gameObject;
                    //    temp1.SetActive(true);
                    //}

                    if (cc == 0)
                    {
                        continue;
                    }

                    temp1.gameObject.GetComponent <RectTransform>().localScale = new Vector3(0.25f, 0.25f, 0.25f);
                    float x = transform.FindChild("worldmap/map/" + cc).localPosition.x;
                    float y = transform.FindChild("worldmap/map/" + cc).localPosition.y;

                    temp1.transform.localPosition = new Vector3(x, y, 0);

                    //ssg.Add(temp1);
                }
            }
        }
示例#9
0
        public void resfreshTeamPos()
        {
            //ssg.Clear();

            TeamProxy.getInstance().SendCurrentMapTeamPos();


            //foreach (var v in goP1.GetComponentsInChildren<Transform>(true))
            //{
            //    if (v.parent == goP1.transform)
            //        v.gameObject.SetActive(false);

            //}
            //===============================================
            //getmapid = true;
            //TeamProxy.getInstance().SendWatchTeamInfo(PlayerModel.getInstance().teamid);


            if (TeamProxy.getInstance().teamlist_position != null && TeamProxy.getInstance().MyTeamData != null)
            {
                for (int i = 0; i < TeamProxy.getInstance().teamlist_position.Count; i++)
                {
                    if (TeamProxy.getInstance().MyTeamData.meIsCaptain == false && TeamProxy.getInstance().MyTeamData.leaderCid == TeamProxy.getInstance().teamlist_position[i].cid)//
                    {
                        temp1 = goP1.transform.FindChild("signalteam").gameObject;
                        temp1.SetActive(true);
                        temp1.gameObject.GetComponent <RectTransform>().localScale = new Vector3(0.25f, 0.25f, 0.25f);
                    }
                    else
                    {
                        temp1 = goP1.transform.FindChild("signal" + i).gameObject;
                        temp1.SetActive(true);
                        temp1.gameObject.GetComponent <RectTransform>().localScale = new Vector3(0.25f, 0.25f, 0.25f);
                    }

                    //if (TeamProxy.getInstance().teamMemberposData[i].online == false)
                    //{
                    //    temp1 = goP1.transform.FindChild("signal_lx").gameObject;
                    //    temp1.SetActive(true);
                    //    temp1.gameObject.GetComponent<RectTransform>().localScale = new Vector3(0.25f, 0.25f, 0.25f);
                    //}



                    // temp1.gameObject.GetComponent<RectTransform>().localScale = new Vector3(0.25f, 0.25f, 0.25f);


                    //ssg.Add(temp1);
                    //===========================================================
                    int x2 = (int)TeamProxy.getInstance().teamlist_position[i].x;

                    int y2 = (int)TeamProxy.getInstance().teamlist_position[i].y;


                    Vector3 vec = SceneCamera.getTeamPosOnMinMap(x2, y2, curMiniMap.mapScale);

                    vec = mapRotation * vec;

                    temp1.transform.localPosition = vec;
                }
            }

            //if (TeamProxy.getInstance().teamlist_position!=null&&TeamProxy.getInstance().teamlist_position.Count != 0)
            //{
            //    for (int i = 0; i < TeamProxy.getInstance().teamlist_position.Count; i++)
            //    {
            //        int x2 = (int)TeamProxy.getInstance().teamlist_position[i].x;

            //        int y2 = (int)TeamProxy.getInstance().teamlist_position[i].y;


            //        Vector3 vec = SceneCamera.getTeamPosOnMinMap(x2, y2, curMiniMap.mapScale);

            //        ssg[i].transform.localPosition = vec;

            //    }
            //}


            //planePic();
        }
示例#10
0
        public override void Execute(float delta_time)
        {
            //exe_action_tm += delta_time;
            //Debug.LogError(string.Format("当前时间:{0},技能开始时间:{1},时间间隔:{2},技能的执行时间:{3}", muNetCleint.instance.CurServerTimeStamp, exe_action_tm, muNetCleint.instance.CurServerTimeStamp - exe_action_tm, xml_action_tm));
            if (muNetCleint.instance.CurServerTimeStamp - exe_action_tm < xml_action_tm || SelfRole._inst.isPlayingSkill)
            {
                return;
            }

            if (mon > 0) //每击杀[一次](不是一只)怪物,额外触发一次拾取物品
            {
                mon--;
                if (!PlayerModel.getInstance().havePet || (PlayerModel.getInstance().havePet&& PlayerModel.getInstance().last_time == 0))
                {
                    SelfRole.fsm.ChangeState(StatePick.Instance);
                }
                return;
            }

            if (SelfRole._inst.m_LockRole != null)
            {
                if (SelfRole._inst.m_LockRole is CollectRole)
                {
                    SelfRole._inst.m_LockRole = null;
                }
                else if (PlayerModel.getInstance().pk_state == PK_TYPE.PK_PEACE)
                {
                    if (SelfRole._inst.m_LockRole is ProfessionRole)
                    {
                        SelfRole._inst.m_LockRole = null;
                    }
                }
                else if (PlayerModel.getInstance().pk_state == PK_TYPE.PK_TEAM && TeamProxy.getInstance().MyTeamData != null)
                {
                    if (TeamProxy.getInstance().MyTeamData.itemTeamDataList.Exists((m) => m.cid == SelfRole._inst.m_LockRole.m_unCID))
                    {
                        SelfRole._inst.m_LockRole = null;
                    }
                }
            }

            //if (SelfRole._inst.m_LockRole is ProfessionRole &&
            //    SelfRole._inst.m_ePK_Type == PK_TYPE.PK_PEACE) // 玩家在和平状态下挂机,手动锁定一个玩家时
            //    SelfRole._inst.m_LockRole = null;
            if (SelfRole._inst.m_LockRole == null)
            {
                if (PlayerModel.getInstance().pk_state != PK_TYPE.PK_PEACE)
                {
                    BaseRole plr = OtherPlayerMgr._inst.FindNearestEnemyOne(SelfRole._inst.m_curModel.transform.position, selector: EnemySelector, pkState: PlayerModel.getInstance().pk_state);
                    if (plr != null)
                    {
                        SelfRole._inst.m_LockRole = plr;
                    }
                }
                if (SelfRole._inst.m_LockRole == null)
                {
                    //if (SelfRole._inst.m_LockRole != null /* || SelfRole._inst.m_LockRole is MonsterRole*/)
                    SelfRole._inst.m_LockRole = MonsterMgr._inst.FindNearestMonster(SelfRole._inst.m_curModel.transform.position);
                    MonsterRole mon = SelfRole._inst.m_LockRole as MonsterRole;
                    try
                    {
                        if (PlayerModel.getInstance().task_monsterIdOnAttack.Count != 0 &&
                            !PlayerModel.getInstance().task_monsterIdOnAttack.ContainsValue(mon.monsterid))
                        {
                            SelfRole._inst.m_LockRole = null;
                            SelfRole.fsm.ChangeState(StateIdle.Instance);
                            return;
                        }
                    }
                    catch (Exception)   // 玩家在"角色接受任务后开始自动战斗"时,猛点空白区域,会引发此异常
                                        // 原因是SelfRole._inst.m_LockRole被强制置为null,导致mon未引用到实例对象
                    {
                        SelfRole._inst.m_LockRole = null;
                        SelfRole.fsm.ChangeState(StateIdle.Instance);
                        return;
                    }
                }
            }
            BaseRole target = SelfRole._inst.m_LockRole;

            try
            {
                Vector3 targetPosition = SelfRole._inst.m_LockRole.m_curModel.position;
            }
            catch (Exception)
            {
                SelfRole._inst.m_LockRole = null;
                SelfRole.fsm.RestartState(this);
                return;
            }
            if (target == null || target.isDead)
            {
                StateTimeover += delta_time;
                if (StateTimeover > 1.5f)
                {
                    StateTimeover = 0f;
                    SelfRole.fsm.MoveToOri();
                    return;
                }
                SelfRole._inst.m_LockRole = null;
                //if (BaseRoomItem.instance.dDropItem.Count != 0)
                //    SelfRole.fsm.ChangeState(StatePick.Instance);
                //else
                //    SelfRole.fsm.RestartState(this);
                if (BaseRoomItem.instance.dDropItem_own.Count != 0)
                {
                    if (!PlayerModel.getInstance().havePet || (PlayerModel.getInstance().havePet&& PlayerModel.getInstance().last_time == 0))
                    {
                        SelfRole.fsm.ChangeState(StatePick.Instance);
                    }
                }
                else
                {
                    SelfRole.fsm.RestartState(this);
                }
                return;
            }

            StateTimeover = 0;
            int          skid   = StateInit.Instance.GetSkillCanUse();
            skill_a3Data skdata = null;

            Skill_a3Model.getInstance().skilldic.TryGetValue(skid, out skdata);
            float range = skdata.range / GameConstant.PIXEL_TRANS_UNITYPOS;

            if (skdata.skillType != 0 && Vector3.Distance(target.m_curModel.position, SelfRole._inst.m_curModel.position) > MinRange)
            {
                if (range < Vector3.Distance(SelfRole._inst.m_curModel.position, target.m_curModel.position))
                {
                    StateAutoMoveToPos.Instance.stopdistance = 2.0f;
                    StateAutoMoveToPos.Instance.pos          = SelfRole._inst.m_LockRole.m_curModel.position;
                    SelfRole.fsm.ChangeState(StateAutoMoveToPos.Instance);
                    return;
                }
            }
            SelfRole._inst.TurnToPos(SelfRole._inst.m_LockRole.m_curModel.position);
            exe_action_tm = muNetCleint.instance.CurServerTimeStamp;
            switch (skid)
            {
            case 2001:
            case 3001:
            case 4001:
            case 5001:
                xml_action_tm = 0;
                break;

            default:
                xml_action_tm = skdata.action_tm * 0.1f;
                break;
            }
            bool ret = a1_gamejoy.inst_skillbar.playSkillById(skid);

            if (ret)
            {
                if (StateInit.Instance.PreferedSkill == skid)
                {
                    StateInit.Instance.PreferedSkill = -1;
                }
            }
            else
            {
                xml_action_tm = 0f;
            }
        }
 void onBtnCancleClick(GameObject go)
 {
     TeamProxy.getInstance().SendAffirmInvite(m_itd.cid, m_itd.teamId, false);
     // TickMgr.instance.removeTick(showTime);
     InterfaceMgr.getInstance().close(InterfaceMgr.A3_TEAMINVITEDPANEL);
 }
示例#12
0
        private void OnSwitch(TabControl t)
        {
            int index = t.getSeletedIndex();

            if (current != null)
            {
                if (currentTeam != null && teamList != null)
                {
                    currentTeam.onClose();
                    currentTeam.gameObject.SetActive(false);
                    teamList.onClose();
                    teamList.gameObject.SetActive(false);
                }

                current.onClose();
                current.gameObject.SetActive(false);
            }

            if (index == 0)
            {
                if (legion == null)
                {
                    GameObject prefab = GAMEAPI.ABLayer_LoadNow_GameObject("uilayer_a3_legion");
                    GameObject panel  = GameObject.Instantiate(prefab) as GameObject;
                    legion = new a3_legion(panel.transform);
                    legion.setPerent(con);
                    legion.transform.localPosition = Vector3.zero;
                }
                current = legion;
            }
            else if (index == 1)
            {
                SetIndexToFriend();
            }
            else
            {
                if (currentTeam == null)
                {
                    GameObject prefab = GAMEAPI.ABLayer_LoadNow_GameObject("uilayer_a3_currentTeamPanel");
                    GameObject panel  = GameObject.Instantiate(prefab) as GameObject;
                    currentTeam = new a3_currentTeamPanel(panel.transform);
                    currentTeam.setPerent(con);
                }
                if (teamList == null)
                {
                    GameObject prefab = GAMEAPI.ABLayer_LoadNow_GameObject("uilayer_a3_teamPanel");
                    GameObject panel  = GameObject.Instantiate(prefab) as GameObject;
                    teamList = new a3_teamPanel(panel.transform);
                    teamList.setPerent(con);
                }
                if (TeamProxy.getInstance().joinedTeam&& TeamProxy.getInstance().MyTeamData != null)
                {
                    current = currentTeam;
                    currentTeam.gameObject.SetActive(true);
                    teamList.gameObject.SetActive(false);
                }
                else
                {
                    current = teamList;
                    currentTeam.gameObject.SetActive(false);
                    teamList.gameObject.SetActive(true);
                }
                TeamProxy.getInstance().SetTeamPanelInfo();
            }

            if (current != null)
            {
                current.onShowed();
                current.visiable = true;
            }
        }
示例#13
0
        public override void Execute(float delta_time)
        {
            //if (dropTimer > dropDruation)
            //{//限定拾取不超时
            //    SelfRole.fsm.ChangeState(StateIdle.Instance);
            //    return;
            //}
            //dropTimer += delta_time;
            SelfRole._inst.m_moveAgent.avoidancePriority = 1;
            if (passed)
            {
                nearest        =
                    pickTarget = null;
            }
            if (nearest == null || !nearest.gameObject)
            {//选取一个掉落目标,移动过去
                DropItem drpitm;
                float    min = float.MaxValue;
                Dictionary <uint, DropItem> .Enumerator etor = BaseRoomItem.instance.dDropItem_own.GetEnumerator();
                while (etor.MoveNext())
                {
                    drpitm = etor.Current.Value;
                    if (drpitm != null && drpitm.gameObject)
                    {
                        bool hasOwner = drpitm.itemdta.ownerId != 0,
                             notMine  = drpitm.itemdta.ownerId != PlayerModel.getInstance().cid ||
                                        (TeamProxy.getInstance().MyTeamData != null && drpitm.itemdta.ownerId == TeamProxy.getInstance().MyTeamData.teamId);
                        if (hasOwner && notMine)
                        {
                            continue;
                        }
                        //!--距离超过拾取范围
                        if (Vector3.Distance(drpitm.transform.position.ConvertToGamePosition(), SelfRole._inst.m_curModel.transform.position.ConvertToGamePosition()) > StateInit.Instance.PickDistance)
                        {
                            continue;
                        }
                        //!--如果背包满且不是金币,不捡
                        if (a3_BagModel.getInstance().curi <= a3_BagModel.getInstance().getItems().Count&& (
                                a3_BagModel.getInstance().getItemNumByTpid((uint)drpitm.itemdta.tpid) == 0 ||
                                a3_BagModel.getInstance().getItemNumByTpid((uint)drpitm.itemdta.tpid) >= a3_BagModel.getInstance().getItemDataById((uint)drpitm.itemdta.tpid).maxnum) &&
                            drpitm.itemdta.tpid != 0)
                        {
                            continue;
                        }

                        if (A3_RollModel.getInstance().rollMapping.ContainsKey(drpitm.itemdta.dpid) && !A3_RollModel.getInstance().rollMapping[drpitm.itemdta.dpid].isCanPick)
                        {
                            continue;
                        }

                        else if (drpitm.canPick && AutoPlayModel.getInstance().WillPick((uint)drpitm.itemdta.tpid))
                        {
                            pickTarget = drpitm;
                            if (nearest == null)
                            {
                                nearest = pickTarget;
                            }
                            else
                            {
                                float dis = Vector3.Distance(pickTarget.transform.position.ConvertToGamePosition(), SelfRole._inst.m_curModel.transform.position.ConvertToGamePosition());
                                if (dis < min)
                                {
                                    min     = dis;
                                    nearest = pickTarget;
                                }
                            }
                        }
                        else
                        {
                            pickTarget = null;
                        }
                    }
                }

                calc_ori = SelfRole._inst.m_curModel.transform.position;
                if (nearest != null)
                {
                    //if (A3_RollModel.getInstance().rollMapping.ContainsKey(nearest.itemdta.dpid))  // 该物品是roll点物品
                    //{
                    //    bool isCanPick = A3_RollModel.getInstance().rollMapping[nearest.itemdta.dpid].isCanPick;

                    //    if (!isCanPick)
                    //    {
                    //        nearest = null;
                    //        calc_tar = Vector3.zero;
                    //    }
                    //    else
                    //    {
                    //        SelfRole._inst.SetDestPos(nearest.transform.position);
                    //        calc_tar = nearest.transform.position;
                    //        return;
                    //    }
                    //}
                    //else {

                    SelfRole._inst.SetDestPos(nearest.transform.position);
                    calc_tar = nearest.transform.position;

                    return;
                    //}
                }
                else
                {
                    calc_tar = Vector3.zero;
                }
            }
            else
            {
                //if (nearest != null)
                //{
                if (nearest.gameObject != null && Vector3.Distance(SelfRole._inst.m_curModel.position.ConvertToGamePosition(), nearest.transform.position.ConvertToGamePosition()) < 0.5f)
                {
                    nearest.PickUpItem();
                    SelfRole._inst.m_curAni.SetBool(EnumAni.ANI_RUN, false);
                    SelfRole.ChangeRideAniState(false);
                    nearest = null;
                }

                if (nearest != null)
                {
                    bool isOutOfTouch = Vector3.Distance(nearest.transform.position.ConvertToGamePosition(), SelfRole._inst.m_curModel.transform.position.ConvertToGamePosition()) > StateInit.Instance.PickDistance;
                    if (!passed && !isOutOfTouch)
                    {
                        SelfRole._inst.TurnToPos(nearest.transform.position);
                        SelfRole._inst.m_curAni.SetBool(EnumAni.ANI_RUN, true);
                        SelfRole.ChangeRideAniState(true);
                    }
                    else
                    {
                        nearest = null;
                        SelfRole._inst.m_curAni.SetBool(EnumAni.ANI_RUN, false);
                        SelfRole.ChangeRideAniState(false);
                    }
                }
                //}
            }


            calc_cur = SelfRole._inst.m_curModel.transform.position;
            passed   = CheckPass(calc_ori, calc_cur, calc_tar);
            if (nearest == null || nearest.gameObject == null)
            {
                SelfRole._inst.m_moveAgent.Stop();
                SelfRole._inst.m_curAni.SetBool(EnumAni.ANI_RUN, false);
                SelfRole.ChangeRideAniState(false);
                if (SelfRole.fsm.Autofighting)
                {
                    SelfRole.fsm.ChangeState(StateAttack.Instance);
                }
                else
                {
                    SelfRole.fsm.ChangeState(StateIdle.Instance);
                }
                return;
            }
        }
 void onBtnCloseClick(GameObject go)
 {
     TickMgr.instance.removeTick(showTime);
     TeamProxy.getInstance().SendAffirmApply(m_itd.cid, false);
     Destroy(m_go);
 }
示例#15
0
 private void OnAddEventListener()
 {
     TeamProxy.getInstance().addEventListener(18, UpdateRoll);
 }
示例#16
0
        public void changetab(int idx)
        {
            if (idx == 0)
            {
                m_goWorldmap.SetActive(true);
                if (TeamProxy.getInstance().MyTeamData != null)
                {
                    InvokeRepeating("teampos", 0, 0.5f);
                }

                //m_goWorldmap.transform.DOKill();
                //m_goWorldmap.transform.position = vecEnd;
                //m_goWorldmap.transform.DOMove(vecBegin, 0.5f);
                m_goMapcon.SetActive(true);
                goTabrole.SetActive(false);
                monsterList.visiable = false;
                npcList.visiable     = false;
                if (a3_active.instance != null)
                {
                    if (a3_active.instance.map_light)
                    {
                        m_goWorldmap.transform.FindChild("map/box_dxc").gameObject.SetActive(true);
                        m_goWorldmap.transform.FindChild("map/box_ahsd").gameObject.SetActive(true);
                    }
                }

                for (int i = 0; i < lMap.Count; i++)
                {
                    lMap[i].refresh();
                }

                if (curMiniMap != null)
                {
                    curMap = curMiniMap.transform.FindChild("a/mainbt/Text").GetComponent <Text>();
                    curMap.gameObject.SetActive(false);
                    ditu.gameObject.SetActive(true);
                }
            }
            else
            {
                if (curMiniMap != null)
                {
                    ditu.gameObject.SetActive(false);
                    curMap = curMiniMap.transform.FindChild("a/mainbt/Text").GetComponent <Text>();
                    curMap.gameObject.SetActive(true);
                }

                m_goWorldmap.SetActive(false);
                InvokeRepeating("worldteampos", 0, 5f);
                //curMap.text=
                //if (firstRun)
                //{
                //    m_goWorldmap.SetActive(false);
                //}
                //else
                //{
                //    m_goWorldmap.transform.DOKill();
                //    m_goWorldmap.transform.position = vecBegin;
                //    m_goWorldmap.transform.DOMove(vecEnd, 0.5f).OnComplete(() =>
                //    {
                //        m_goWorldmap.SetActive(false);
                //    });
                //}
                m_goMapcon.SetActive(true);
                goTabrole.SetActive(true);
                onRoleTab(2);
                if (mapid == 0)
                {
                    mapid = GRMap.instance.m_nCurMapID;
                }



                if (curMiniMap == null || curMiniMap.id != mapid)
                {
                    refreshMiniMap();
                }

                refreshPos();

                SXML        xml = XMLMgr.instance.GetSXML("mappoint");
                List <SXML> l   = xml.GetNodeList("p", "mapid==" + mapid);
                npcList.refresh(l);
                wayList.refresh(l);
                monsterList.refresh(l);
            }
            firstRun = false;
        }
示例#17
0
 private void RemoveEventListener()
 {
     TeamProxy.getInstance().removeEventListener(18, UpdateRoll);
 }
示例#18
0
        public override void init()
        {
            _instance = this;
            ditu      = getComponentByPath <Text>("shijieditu");
            // PlayerModel.SendPosition();
            m_goWorldmap = getGameObjectByPath("worldmap");
            //vecBegin = m_goWorldmap.transform.position;
            //vecEnd = vecBegin;
            //vecEnd.y = 600f;
            //m_goWorldmap.transform.position = vecEnd;
            m_goMapcon = getGameObjectByPath("mapcon");

            btclose         = new BaseButton(getTransformByPath("btclose"));
            btclose.onClick = onClose;

            btGoCity         = new BaseButton(getTransformByPath("tabrole/gotomain"));
            btGoCity.onClick = onGotoCity;

            GameObject temp = getGameObjectByPath("tabrole/temp");

            temp.SetActive(false);
            tempH       = temp.GetComponent <RectTransform>().sizeDelta.y;
            npcList     = new ItemList(getTransformByPath("tabrole/npcmain"), 0, temp, onNpcListClick, onMonsterListClick, onWayListClick);
            monsterList = new ItemList(getTransformByPath("tabrole/monstermain"), 1, temp, onNpcListClick, onMonsterListClick, onWayListClick);
            wayList     = new ItemList(getTransformByPath("tabrole/waymain"), 2, temp, onNpcListClick, onMonsterListClick, onWayListClick);
            goTabrole   = getGameObjectByPath("tabrole");

            tick = new TickItem(onUpdate);

            tab = new TabControl();
            tab.onClickHanle = ontab;

            tab.create(getGameObjectByPath("tab"), gameObject, 0, 0);



            goP   = getGameObjectByPath("mapcon/p");
            goP1  = getGameObjectByPath("mapcon/icon");
            goP22 = transform.FindChild("worldmap/icon").gameObject;
            //BaseButton btnChangeLine = new BaseButton(getTransformByPath("tabrole/btnChangeLine"));
            //btnChangeLine.onClick = onBtnChangeLineClick;


            initWorldMap();



            if (m_goMapcon.activeInHierarchy && TeamProxy.getInstance().MyTeamData != null)
            {
                teampos();
            }
            //resfreshTeamPos();
            mapRotation = Quaternion.Euler(0f, 0f, 0f);


            getComponentByPath <Text>("tab/world/Text").text = ContMgr.getCont("worldmap_0");
            getComponentByPath <Text>("tab/map/Text").text   = ContMgr.getCont("worldmap_1");
            getComponentByPath <Text>("tabrole/monstermain/way/Text").text     = ContMgr.getCont("worldmap_2");
            getComponentByPath <Text>("tabrole/monstermain/monster/Text").text = ContMgr.getCont("worldmap_3");
            getComponentByPath <Text>("tabrole/npcmain/way/Text").text         = ContMgr.getCont("worldmap_2");
            getComponentByPath <Text>("tabrole/npcmain/monster/Text").text     = ContMgr.getCont("worldmap_3");
            getComponentByPath <Text>("tabrole/waymain/way/Text").text         = ContMgr.getCont("worldmap_2");
            getComponentByPath <Text>("tabrole/waymain/monster/Text").text     = ContMgr.getCont("worldmap_3");
            getComponentByPath <Text>("tabrole/gotomain/Text").text            = ContMgr.getCont("worldmap_4");
            getComponentByPath <Text>("tabrole/btnChangeLine/Text").text       = ContMgr.getCont("worldmap_5");
            getComponentByPath <Text>("worldmap/title/Text").text = ContMgr.getCont("worldmap_6");
            getComponentByPath <Text>("worldmap/name").text       = ContMgr.getCont("worldmap_7");
            getComponentByPath <Text>("shijieditu").text          = ContMgr.getCont("worldmap_7");
            transform.SetAsLastSibling();
        }
            public void Set(ItemTeamData itd)
            {
                tid = itd.teamId;
                uint lv = PlayerModel.getInstance().up_lvl * 100 + PlayerModel.getInstance().lvl;

                txtCapatain.text  = itd.name;
                txtLvl.text       = itd.zhuan + ContMgr.getCont("zhuan") + itd.lvl.ToString() + ContMgr.getCont("ji");
                txtKnightage.text = itd.knightage;
                if (a3_teamPanel._instance.iconSpriteDic.ContainsKey(itd.carr))
                {
                    //iconCarr.sprite = a3_teamPanel._instance.iconSpriteDic[itd.carr];
                    iconCarr_zy.transform.FindChild("" + itd.carr).gameObject.SetActive(true);
                    iconCarr_head.transform.FindChild("" + itd.carr).gameObject.SetActive(true);
                }
                txtMap.text       = SvrMapConfig.instance.getSingleMapConf((uint)itd.mapId) == null ? "" : SvrMapConfig.instance.getSingleMapConf((uint)itd.mapId)["map_name"]._str;;
                txtMembCount.text = string.Format(strMembCount, itd.curcnt, 5);


                if (itd.members != null)
                {
                    for (int i = 0; i < itd.members.Count; i++)
                    {
                        prefab.transform.FindChild("team_pre/3/zy/teamer/" + (i + 1) + "/" + itd.members[i]).gameObject.SetActive(true);
                    }
                }

                int v = 0;

                switch (itd.ltpid)
                {
                case 0:
                    v = 5;    //自定义
                    break;

                case 1:
                    v = 4;    //挂机
                    break;

                case 2:
                    v = 3;
                    break;

                case 105:
                    v = 2;
                    break;

                case 108:
                    v = 1;
                    break;

                case 109:
                    v = 6;
                    break;

                case 110:
                    v = 7;
                    break;
                }

                limited_dj = Set_Limited_dj(v);


                if (limited_dj == 0)
                {
                    prefab.transform.FindChild("team_pre/3/dj").GetComponent <Text>().text = ContMgr.getCont("a3_SpeedTeamtxt1");
                }
                else
                {
                    prefab.transform.FindChild("team_pre/3/dj").GetComponent <Text>().text = up_lvl + ContMgr.getCont("zhuan") + lvl + ContMgr.getCont("ji");
                }

                if (itd.curcnt >= 5)
                {
                    prefab.transform.FindChild("team_pre/4/full").gameObject.SetActive(true);
                    prefab.transform.FindChild("team_pre/4/apply").gameObject.SetActive(false);
                    prefab.transform.FindChild("team_pre/4/applyed").gameObject.SetActive(false);
                }
                if (TeamProxy.getInstance().MyTeamData == null && itd.curcnt < 5)
                {
                    prefab.transform.FindChild("team_pre/4/full").gameObject.SetActive(false);
                    prefab.transform.FindChild("team_pre/4/apply").gameObject.SetActive(true);
                    prefab.transform.FindChild("team_pre/4/applyed").gameObject.SetActive(false);
                }
                if (itd.curcnt < 5 && prefab.transform.FindChild("team_pre/4/applyed").gameObject.activeInHierarchy == false && lv >= limited_dj)
                {
                    prefab.transform.FindChild("team_pre/4/full").gameObject.SetActive(false);
                    prefab.transform.FindChild("team_pre/4/apply").gameObject.SetActive(true);
                    prefab.transform.FindChild("team_pre/4/applyed").gameObject.SetActive(false);

                    new BaseButton(prefab.transform.FindChild("team_pre/4/apply")).onClick = (GameObject oo) =>
                    {
                        if (TeamProxy.getInstance().MyTeamData == null && lv >= limited_dj)
                        {
                            //Debug.LogError(data.teamId);
                            TeamProxy.getInstance().SendApplyJoinTeam(itd.teamId);
                            prefab.transform.FindChild("team_pre/4/apply").gameObject.SetActive(false);
                            prefab.transform.FindChild("team_pre/4/applyed").gameObject.SetActive(true);
                        }
                        else if (TeamProxy.getInstance().MyTeamData != null && lv >= limited_dj)
                        {
                            flytxt.instance.fly(ContMgr.getCont("a3_teamPanel_goout"));
                        }
                        else
                        {
                            flytxt.instance.fly(ContMgr.getCont("a3_teamPanel_lvlock"));
                        }
                    };
                }
            }
 private void OnClickMsg(GameObject go)
 {
     if (!PlayerModel.getInstance().IsCaptain)
     {
         flytxt.instance.fly(ContMgr.getCont("a3_currentTeamPanel_not_captain")); return;
     }
     if (PlayerModel.getInstance().inFb)
     {
         flytxt.instance.fly(ContMgr.getCont("a3_currentTeamPanel_in_fb")); return;
     }
     a3_chatroom._instance.SendMsg(string.Format("{0}:{1}:{2}", TeamProxy.getInstance().MyTeamData.teamId, curTeamType, TeamProxy.getInstance().mapItemTeamData == null?0: TeamProxy.getInstance().mapItemTeamData.ldiff), chatType: ChatToType.World, xtp: 1);
 }
示例#21
0
 void OnDestroy()
 {
     TeamProxy.getInstance().removeEventListener(PKG_NAME.S2C_LVL_PVPINFO_BOARD_RES, killNum);
 }
        public void init(Transform trans)
        {
            _instance = this;
            inText();
            itemMemberObjList = new List <ItemMemberObj>();
            txtTeambuff       = trans.FindChild("right/bottom/teambuff").GetComponent <Text>();
            Transform objects = trans.FindChild("right/main/body/contains");

            team_object        = transform.FindChild("right/bottom/team_object/Dropdown").gameObject;
            team_object_change = team_object.GetComponent <Dropdown>();
            team_object_change.onValueChanged.AddListener(team_object_dropdownClick);


            team_object_change.captionText.text = ContMgr.getCont("a3_teamPanel_16");
            for (int i = 0; i < team_object_change.options.Count; i++)
            {
                team_object_change.options[i].text = ContMgr.getCont("a3_teamPanel_" + (i + 16));
            }

            for (int i = 0; i < objects.childCount; i++)
            {
                Transform     child         = objects.GetChild(i);
                ItemMemberObj itemMemberObj = new ItemMemberObj(child);
                itemMemberObjList.Add(itemMemberObj);
            }
            togInvite = trans.FindChild("right/bottom/togInvite").GetComponent <Toggle>();
            /*暂时先屏蔽掉*/ //togJoin = trans.FindChild("right/bottom/togJoin").GetComponent<Toggle>();
            togInvite.onValueChanged.AddListener(onTogAgreenAddOtherClick);
            //togJoin.onValueChanged.AddListener(onTogAgreeOtherApplyClick);
            materialGrey  = U3DAPI.U3DResLoad <Material>("uifx/uiGray");
            carrSpriteDic = new Dictionary <uint, Sprite>();

            for (int i = 0; i < 3; i++)
            {
                if (i == 0)
                {
                    carrSpriteDic.Add(2, GAMEAPI.ABUI_LoadSprite("icon_team_warrior_team"));
                }
                if (i == 1)
                {
                    carrSpriteDic.Add(3, GAMEAPI.ABUI_LoadSprite("icon_team_mage_team"));
                }
                if (i == 2)
                {
                    carrSpriteDic.Add(5, GAMEAPI.ABUI_LoadSprite("icon_team_assassin_team"));
                }
            }
            BaseButton btnQuitTeam = new BaseButton(trans.FindChild("right/bottom/btnQuitTeam"));

            btnQuitTeam.onClick = onBtnQuitTeamClick;
            TeamProxy.getInstance().addEventListener(TeamProxy.EVENT_CREATETEAM, onCreateTeam);
            TeamProxy.getInstance().addEventListener(TeamProxy.EVENT_AFFIRMINVITE, onAffirminvite);
            TeamProxy.getInstance().addEventListener(TeamProxy.EVENT_NEWMEMBERJOIN, onNewMemberJoin);
            TeamProxy.getInstance().addEventListener(TeamProxy.EVENT_KICKOUT, onNoticeHaveMemberLeave);
            TeamProxy.getInstance().addEventListener(TeamProxy.EVENT_CHANGETEAMINFO, onChangeTeamInfo);
            TeamProxy.getInstance().addEventListener(TeamProxy.EVENT_NOTICEHAVEMEMBERLEAVE, onNoticeHaveMemberLeave);
            TeamProxy.getInstance().addEventListener(TeamProxy.EVENT_LEAVETEAM, onLeaveTeam);
            TeamProxy.getInstance().addEventListener(TeamProxy.EVENT_NOTICEONLINESTATECHANGE, onNoticeOnlineStateChange);
            TeamProxy.getInstance().addEventListener(TeamProxy.EVENT_CHANGECAPTAIN, onChangeCaptain);
            TeamProxy.getInstance().addEventListener(TeamProxy.EVENT_TEAMOBJECT_CHANGE, onChangeTeamObject);
            if (TeamProxy.getInstance().MyTeamData != null)
            {
                team_object_change.value = change_v((int)TeamProxy.getInstance().MyTeamData.ltpid, false);
            }

            new BaseButton(transform.Find("right/main/body/btn_call")).onClick = OnClickMsg;
        }
        //锁定技能的处理(能否攻击)
        static public bool RefreshLockSkill(BaseRole LockRole)
        {
            if (LockRole.isDead || LockRole == null)
            {
                return(false);
            }
            if (LockRole is MonsterRole)
            {
                return(true);
            }
            else
            {
                if (OtherPlayerMgr._inst.m_mapOtherPlayer[LockRole.m_unIID].zhuan < 1)
                {
                    return(false);
                }
                switch (PlayerModel.getInstance().pk_state)
                {
                case PK_TYPE.PK_PEACE:
                    if (!LockRole.havefanjibuff)
                    {
                        return(false);
                    }
                    else
                    {
                        return(true);
                    }

                case PK_TYPE.PK_PKALL:
                    return(true);

                case PK_TYPE.PK_TEAM:
                    bool canattack = false;
                    if (LockRole is ProfessionRole)
                    {
                        if (TeamProxy.getInstance().MyTeamData != null && TeamProxy.getInstance().MyTeamData.IsInMyTeam(LockRole.roleName))
                        {
                            canattack = false;
                        }
                        else
                        {
                            if (PlayerModel.getInstance().clanid == 0)
                            {
                                canattack = true;
                            }
                            else
                            {
                                canattack = PlayerModel.getInstance().clanid == LockRole.m_unLegionID ? false : true;
                            }
                        }
                    }
                    if (canattack)
                    {
                        return(true);
                    }
                    else
                    {
                        return(false);
                    }

                //return (LockRole is ProfessionRole && (TeamProxy.getInstance().MyTeamData?.itemTeamDataList.Exists((m) => m.cid == LockRole.m_unCID) ?? true));
                case PK_TYPE.PK_LEGION:
                    break;

                case PK_TYPE.PK_HERO:
                    if (LockRole.rednm > 0)
                    {
                        return(true);
                    }
                    return(false);

                case PK_TYPE.Pk_SPOET:
                    bool canattack1 = false;
                    if (LockRole is ProfessionRole)
                    {
                        if (PlayerModel.getInstance().lvlsideid == LockRole.lvlsideid)
                        {
                            canattack1 = false;
                        }
                        else
                        {
                            canattack1 = true;
                        }
                    }
                    return(canattack1);
                }
                ;
            }
            return(false);
        }
 void onTogAgreenAddOtherClick(bool b)
 {
     TeamProxy.getInstance().SendEditorInfoMembInv(b);
 }
        override public void onShowed()
        {
            TeamProxy.getInstance().addEventListener(TeamProxy.EVENT_SYNCTEAMBLOOD, onSyncTeamBlood);
            TeamProxy.getInstance().addEventListener(TeamProxy.EVENT_LEAVETEAM, onLeaveTeam);
            TeamProxy.getInstance().addEventListener(TeamProxy.EVENT_DISSOLVETEAM, onDissolveTeam);
            TeamProxy.getInstance().addEventListener(TeamProxy.EVENT_NOTICEHAVEMEMBERLEAVE, onNoticeHaveMemberLeave);
            TeamProxy.getInstance().addEventListener(TeamProxy.EVENT_AFFIRMINVITE, onAffirmInvite);
            TeamProxy.getInstance().addEventListener(TeamProxy.EVENT_KICKOUT, onNoticeHaveMemberLeave);
            TeamProxy.getInstance().addEventListener(TeamProxy.EVENT_NEWMEMBERJOIN, onNewMemberJoin);
            TeamProxy.getInstance().addEventListener(TeamProxy.EVENT_CHANGETEAMINFO, onChangeTeamInfo);
            TeamProxy.getInstance().addEventListener(TeamProxy.EVENT_NOTICEONLINESTATECHANGE, onNoticeOnlineStateChange);

            if (uiData != null)
            {
                Transform parent = (Transform)uiData[0];
                this.transform.SetParent(parent, false);
                this.transform.localScale    = Vector3.one;
                this.transform.localPosition = Vector3.one;
                InvokeRepeating("SendSyncTeamBlood", 0.0f, 3f);//TODO:暂定1秒
                if (TeamProxy.getInstance().MyTeamData != null)
                {
                    for (int i = 0; i < TeamProxy.getInstance().MyTeamData.itemTeamDataList.Count; i++)
                    {
                        uint cid = TeamProxy.getInstance().MyTeamData.itemTeamDataList[i].cid;
                        if (cid == PlayerModel.getInstance().cid)
                        {
                            continue;
                        }
                        if (m_ItemCurrentTeamInfoDic != null && !m_ItemCurrentTeamInfoDic.ContainsKey(cid))
                        {
                            ItemCurrentTeamInfo icti = new ItemCurrentTeamInfo(itemCurrentInfoPrefab);
                            string name = TeamProxy.getInstance().MyTeamData.itemTeamDataList[i].name;
                            icti.SetTxtName(name);
                            m_ItemCurrentTeamInfoDic.Add(cid, icti);
                        }
                    }
                    if (TeamProxy.getInstance().MyTeamData.itemTeamDataList.Count < 5)
                    {
                        if (TeamProxy.getInstance().MyTeamData.meIsCaptain)
                        {
                            getGameObjectByPath("contant/friend").SetActive(true);
                            getTransformByPath("contant/friend").SetAsLastSibling();//放到最后
                        }
                        else
                        {
                            if (TeamProxy.getInstance().MyTeamData.membInv)
                            {
                                getGameObjectByPath("contant/friend").SetActive(true);
                                getTransformByPath("contant/friend").SetAsLastSibling();//放到最后
                            }
                            else
                            {
                                getGameObjectByPath("contant/friend").SetActive(false);
                            }
                        }
                    }
                    else
                    {
                        getGameObjectByPath("contant/friend").SetActive(false);
                    }
                }
            }
        }
示例#26
0
        void getPublish(Variant data)
        {
            if (data.ContainsKey("tp") && data["tp"] != 10)
            {
                UnityEngine.Debug.Log("聊天所有信息" + data.dump());
            }
            if (data.ContainsKey("cid"))
            {
                uint cid = data["cid"]._uint;
                if (FriendProxy.getInstance().BlackDataList.ContainsKey(cid))
                {
                    return;
                }
            }
            if (data.ContainsKey("res"))
            {
                int res = data["res"];
                if (res < 0)//-158
                {
                    Globle.err_output(res);
                    return;
                }
                if (res == 1)//私聊玩家存在情况下
                {
                    a3_chatroom._instance.meSays(false);
                }
            }
            else
            {
                switch ((ChatToType)data["tp"]._int)
                {
                case ChatToType.Nearby:
                    if (!data.ContainsKey("url"))
                    {
                        uint   cid = data["cid"]._uint;
                        string msg = data["msg"]._str;
                        foreach (KeyValuePair <uint, ProfessionRole> item in OtherPlayerMgr._inst.m_mapOtherPlayerSee)
                        {
                            if (item.Value.m_unCID == cid)
                            {
                                PlayerChatUIMgr.getInstance().show(item.Value, analysisStrName(msg));
                            }
                        }
                    }

                    break;

                case ChatToType.PrivateSecretlanguage:
                    if (GlobleSetting.IGNORE_PRIVATE_INFO)
                    {
                        return;                                       //客户端开启屏蔽私聊信息
                    }
                    break;
                }
                // UIClient.instance.dispatchEvent(GameEvent.Create(UI_EVENT.GET_PUBLISH, this, data));

                if (data["tp"] == 10)
                {//系统消息特殊处理,走马灯的同时,聊天框也要显示
                    if (broadcasting.instance != null)
                    {
                        broadcasting.instance.addGonggaoMsg(data["msg"]);
                    }

                    data["tp"] = (int)ChatToType.SystemMsg;
                    if (a3_chatroom._instance != null)
                    {
                        a3_chatroom._instance.otherSays(data);
                    }
                }
                else if (data["tp"] == 11)
                {
                    data["tp"] = (int)ChatToType.LegionSystemMsg;
                    if (data.ContainsKey("guard_time"))
                    {
                        if (A3_LegionModel.getInstance().myLegion.lvl > 1)
                        {
                            data["msg"] = ContMgr.getCont(("clan_log_12"), new List <string>()
                            {
                                (3 - data["guard_time"]).ToString(), (A3_LegionModel.getInstance().myLegion.lvl - 1).ToString()
                            });
                        }
                        else
                        {
                            data["msg"] = ContMgr.getCont(("clan_log_11"), new List <string>()
                            {
                                (3 - data["guard_time"]).ToString()
                            });
                        }

                        if (a3_chatroom._instance != null)
                        {
                            a3_chatroom._instance.otherSays(data);
                        }
                    }
                }
                else if (data["tp"] == 12)
                {
                    InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_CITYWARTIP);
                }
                else
                {
                    if (a3_chatroom._instance != null)
                    {
                        List <Variant> lp = null;
                        if (data.ContainsKey("xtp"))
                        {
                            int xtp = data["xtp"]._int;
                            switch (xtp)
                            {
                            case 1:
                                data = AnalysisData(data, out lp, xtp);
                                if (lp.Count == 6 &&
                                    lp[5].ContainsKey("tid") &&
                                    TeamProxy.getInstance()?.MyTeamData != null &&
                                    lp[5]["tid"] == TeamProxy.getInstance().MyTeamData.teamId&&
                                    PlayerModel.getInstance().IsCaptain)     //反馈仅对队长可见
                                {
                                    flytxt.instance.fly(ContMgr.getCont("a3_currentTeamPanel_in_fb2"));
                                }
                                break;

                            default: break;
                            }
                        }
                        a3_chatroom._instance.otherSays(data, lp);
                    }
                }
            }
        }