Beispiel #1
0
    public void AddToList(PushPointClass pointDataParams)
    {
        if (pointDataParams.msgs.Count != 0)
        {
            radiusDistance = int.Parse(pointDataParams.radius);
            foreach (PushMsg item in pointDataParams.msgs)
            {
                PushItem pushItemMsg = new PushItem();
                pushItemMsg.id = item.id;


                float XX = float.Parse(item.locationX);
                float yy = float.Parse(item.locationY);

                pushItemMsg.locationX = item.locationX;
                pushItemMsg.locationY = item.locationY;
                pushItemMsg.height    = item.height;
                pushItemMsg.title     = item.title;
                pushItemMsg.msg       = item.msg;
                pushItemMsg.distance  = 10000;
                pushItemMsg.pos       = new Vector2(XX, yy);

                pushItemMsg.dbid = item.dbid;
                pushItemMsg.type = item.type;
                //      Debug.Log("pointdata====" + pushItemMsg.title+"--"+ pushItemMsg.msg + "--" + pushItemMsg.pos);
                pushPointIndexV2Dic.Add(int.Parse(pushItemMsg.id), pushItemMsg);
            }
        }
    }
Beispiel #2
0
    public void LoadPushJson()
    {
        string reader = JsonManager.ReadJsonFromFilePath(UnityHelper.LocalFilePath + "Push/" + PublicAttribute.AreaId + "/", "content.json");

        if (reader != null)
        {
            Debug.Log("reader不为空=====" + reader);
            pushPointClass = JsonMapper.ToObject <PushPointClass>(reader);
            AddToList(pushPointClass);
        }
        else
        {
            Debug.Log("reader为空=====" + reader);
        }
    }