Exemplo n.º 1
0
    void OnClickMsg(GameObject o)
    {
        // 发送事件

        //显示切换目标
        es = Client.ClientGlobal.Instance().GetEntitySystem();
        if (es != null)
        {
            IPlayer m_curTarget = es.FindPlayer(this.teamMemberInfo.id);
            if (m_curTarget != null)
            {
                Client.stTargetChange targetChange = new Client.stTargetChange();
                targetChange.target = m_curTarget;
                Engine.Utility.EventEngine.Instance().DispatchEvent((int)GameEventID.ENTITYSYSTEM_TARGETCHANGE, targetChange);
            }
        }

        //左侧最远操作界面
        if (DataManager.Manager <UIPanelManager>().IsShowPanel(PanelID.MissionAndTeamPanel))
        {
            stTeamMemberBtn teamMemberBtn = new stTeamMemberBtn();
            teamMemberBtn.id    = this.teamMemberInfo.id;
            teamMemberBtn.name  = this.teamMemberInfo.name;
            teamMemberBtn.pos_y = this.transform.position.y;

            DataManager.Manager <UIPanelManager>().SendMsg(PanelID.MissionAndTeamPanel, UIMsgID.eTeamMemberBtn, teamMemberBtn);
        }
    }
Exemplo n.º 2
0
    /// <summary>
    /// 切换目标
    /// </summary>
    /// <param name="id"></param>
    void SelectTargetChange(uint id)
    {
        //切换目标
        IEntitySystem es = Client.ClientGlobal.Instance().GetEntitySystem();

        if (es != null)
        {
            IPlayer m_curTarget = es.FindPlayer(id);
            if (m_curTarget != null)
            {
                //检测视野(策划要求不做视野检测)
                //if (es.CheckEntityVisible(m_curTarget))
                //检测搜索范围
                if (es.CheckSearchRange(m_curTarget))
                {
                    Client.IControllerSystem cs = Client.ClientGlobal.Instance().GetControllerSystem();
                    if (cs != null)
                    {
                        //如果在挂机先停止(清任务目标),再开始,打指定目标
                        if (cs.GetCombatRobot().Status == CombatRobotStatus.RUNNING)
                        {
                            cs.GetCombatRobot().Stop();
                            cs.GetCombatRobot().Start();
                        }
                    }

                    Client.ClientGlobal.Instance().GetControllerSystem().GetActiveCtrl().UpdateTarget(m_curTarget);

                    Client.stTargetChange targetChange = new Client.stTargetChange();
                    targetChange.target = m_curTarget;
                    Engine.Utility.EventEngine.Instance().DispatchEvent((int)GameEventID.SKILLSYSYTEM_TAB, targetChange);

                    // Engine.Utility.EventEngine.Instance().DispatchEvent((int)GameEventID.ENTITYSYSTEM_TARGETCHANGE, targetChange);
                }
                else
                {
                    TipsManager.Instance.ShowTips("目标不在附近");
                }
            }
            else
            {
                TipsManager.Instance.ShowTips("目标不在附近");
            }
        }
    }
Exemplo n.º 3
0
    private void OnSetEntityHide(ref stEntityHide st)
    {
        IEntity entity = GetEntity(st.uid);

        if (entity == null)
        {
            Engine.Utility.Log.Error("找不到对象------------" + st.uid);
            return;
        }
        IControllerSystem cs = ClientGlobal.Instance().GetControllerSystem();

        if (cs == null)
        {
            return;
        }
        if (st.bHide)
        {
            IEntity currtarget = cs.GetActiveCtrl().GetCurTarget();
            if (currtarget != null)
            {
                if (currtarget.GetUID() == entity.GetUID())
                {
                    Client.stTargetChange targetChange = new Client.stTargetChange();
                    targetChange.target = null;
                    Engine.Utility.EventEngine.Instance().DispatchEvent((int)GameEventID.ENTITYSYSTEM_TARGETCHANGE, targetChange);
                }
            }
        }

        IPlayer mainPalyer = MainPlayerHelper.GetMainPlayer();

        if (entity.GetEntityType() == EntityType.EntityType_Player && mainPalyer != null)
        {
            if (mainPalyer.GetUID() != st.uid)
            {
                IControllerHelper ch = cs.GetControllerHelper();
                if (ch == null)
                {
                    return;
                }
                if (st.bHide)
                {
                    if (ch.IsSameTeam(entity))
                    {
                        SetBarVisible(entity.GetUID(), true, 0.3f);
                        entity.SendMessage(EntityMessage.EntityCommond_SetAlpha, 0.3f);
                    }
                    else
                    {
                        SetBarVisible(entity.GetUID(), false);
                        entity.SendMessage(EntityMessage.EntityCommand_SetVisible, false);
                    }
                }
                else
                {
                    SetBarVisible(entity.GetUID(), true);
                    entity.SendMessage(EntityMessage.EntityCommond_SetAlpha, 1.0f);
                    entity.SendMessage(EntityMessage.EntityCommand_SetVisible, true);
                }
            }
            else
            {
                if (st.bHide)
                {
                    SetBarVisible(entity.GetUID(), true, 0.3f);
                    entity.SendMessage(EntityMessage.EntityCommond_SetAlpha, 0.3f);
                }
                else
                {
                    SetBarVisible(entity.GetUID(), true);
                    entity.SendMessage(EntityMessage.EntityCommond_SetAlpha, 1.0f);
                    entity.SendMessage(EntityMessage.EntityCommand_SetVisible, true);
                }
            }
        }
        else
        {
            if (st.bHide)
            {
                SetBarVisible(entity.GetUID(), false);
                entity.SendMessage(EntityMessage.EntityCommand_SetVisible, false);
            }
            else
            {
                SetBarVisible(entity.GetUID(), true);
                entity.SendMessage(EntityMessage.EntityCommond_SetAlpha, 1.0f);
                entity.SendMessage(EntityMessage.EntityCommand_SetVisible, true);
            }
        }
    }