Ejemplo n.º 1
0
 void SetCampNpOnTrigger(GameCmd.eCamp mycamp)
 {
     Client.IEntitySystem es = Client.ClientGlobal.Instance().GetEntitySystem();
     if (es != null)
     {
         es.FindAllEntity <Client.INPC>(ref m_lstNpc);
         for (int i = 0; i < m_lstNpc.Count; i++)
         {
             Client.INPC   npc  = m_lstNpc[i];
             GameCmd.eCamp camp = (GameCmd.eCamp)npc.GetProp((int)Client.CreatureProp.Camp);
             if (mycamp != camp)
             {
                 CampNpcOnTrigger callback = new CampNpcOnTrigger();
                 npc.SetCallback(callback);
                 UnityEngine.Debug.Log("SetCallback : " + npc.GetName());
             }
         }
         m_lstNpc.Clear();
     }
 }
Ejemplo n.º 2
0
    /// <summary>
    /// 附近的人(从服务器获取数据,当前地图的人)先注释,改为获取9屏幕
    /// </summary>
    /// <returns></returns>

    /*
     * public List<People> GetNearbyPeopleList()
     * {
     *  List<People> peopleList = new List<People>();
     *
     *  for (int i = 0; i < m_InvitePeopleList.Count; i++)
     *  {
     *      if (Client.ClientGlobal.Instance().IsMainPlayer(m_InvitePeopleList[i].id))//排除自己
     *      {
     *          continue;
     *      }
     *
     *      if (DataManager.Manager<TeamDataManager>().IsMember(m_InvitePeopleList[i].id))//排除已经加入的队员
     *      {
     *          continue;
     *      }
     *
     *      peopleList.Add(new People
     *      {
     *          peopleType = PeopleType.Nearby,
     *          id = m_InvitePeopleList[i].id,
     *          name = m_InvitePeopleList[i].name,
     *          profession = m_InvitePeopleList[i].job,
     *          lv = m_InvitePeopleList[i].level,
     *          alreadyInvite = false
     *      });
     *  }
     *  return peopleList;
     * }
     */

    /// <summary>
    /// 附近的人(9屏数据)
    /// </summary>
    /// <returns></returns>
    public List <People> GetNearbyPeopleList()
    {
        List <People> peopleList = new List <People>();

        Client.IEntitySystem es = Client.ClientGlobal.Instance().GetEntitySystem();

        m_lstPlayer.Clear();
        if (es != null)
        {
            es.FindAllEntity <Client.IPlayer>(ref m_lstPlayer);
        }

        for (int i = 0; i < m_lstPlayer.Count; i++)
        {
            if (Client.ClientGlobal.Instance().IsMainPlayer(m_lstPlayer[i]))//排除自己
            {
                continue;
            }

            if (DataManager.Manager <TeamDataManager>().IsMember(m_lstPlayer[i].GetID()))//排除已经加入的队员
            {
                continue;
            }

            peopleList.Add(new People
            {
                peopleType    = PeopleType.Nearby,
                id            = m_lstPlayer[i].GetID(),
                name          = m_lstPlayer[i].GetName(),
                profession    = (uint)m_lstPlayer[i].GetProp((int)Client.PlayerProp.Job),
                lv            = (uint)m_lstPlayer[i].GetProp((int)Client.CreatureProp.Level),
                alreadyInvite = false
            });
        }
        return(peopleList);
    }