コード例 #1
0
    void DrawRespondingLine(ReadFileSpawnOnMap.Geometry response)
    {
        AbstractMap _map = CustomSpawnOnMap.instance._map;

        //_map.OnUpdated += UpdateLine;
        var meshData = new MeshData();
        var dat      = new List <Vector3>();

        foreach (List <double> point in response.coordinates)
        {
            Debug.Log("Adding ponts ");

            dat.Add(Conversions.GeoToWorldPosition(point[1], point[0], _map.CenterMercator, _map.WorldRelativeScale).ToVector3xz());
        }

        var feat = new VectorFeatureUnity();

        feat.Points.Add(dat);

        foreach (MeshModifier mod in CustomSpawnOnMap.instance.MeshModifiers.Where(x => x.Active))
        {
            mod.Run(feat, meshData, _map.WorldRelativeScale);
        }

        GameObject go = CreateGameObject(meshData);

        go.transform.SetParent(this.gameObject.transform);
    }
コード例 #2
0
    /// <summary>
    /// Initialize the device on map
    /// </summary>
    public void Initialize()
    {
        _DictionaryObjects = new ArrayList();
        Sizeofsingle       = scroll.content.sizeDelta;
        Destroy(scroll.content.GetChild(0).gameObject);
        int count = SingleObjectData.Count;



        foreach (KeyValuePair <string, object> keyValue in SingleObjectData)
        {
            GameObject go = Instantiate(_singleKeyValueprefab, scroll.content.transform);
            _DictionaryObjects.Add(go);
            string key   = keyValue.Key;
            object value = keyValue.Value;
            if (key == "deviceid")
            {
                DeviceID = value.ToString();
            }

            if (key == "geometry")
            {
                containsGeometry = true;
                object Newtemp = value;
                ReadFileSpawnOnMap.Geometry geo = JsonConvert.DeserializeObject <ReadFileSpawnOnMap.Geometry>(Newtemp.ToString());
                Debug.Log(Newtemp.ToString());
                DrawRespondingLine(geo);
            }

            go.GetComponent <PopulateDictionaryPrefab>().UpdateMykeyValue(key, value.ToString());
        }

        scroll.content.sizeDelta = new Vector2(Sizeofsingle.x, +Sizeofsingle.y * count);
    }
コード例 #3
0
    void DrawRespondingLine(ReadFileSpawnOnMap.Geometry response)
    {
        var meshData = new MeshData();
        var dat      = new List <Vector3>();

        foreach (List <double> point in response.coordinates)
        {
            Debug.Log("Adding ponts ");
            dat.Add(Conversions.GeoToWorldPosition(point[1], point[0], _map.CenterMercator, _map.WorldRelativeScale).ToVector3xz());
        }

        var feat = new VectorFeatureUnity();

        feat.Points.Add(dat);

        foreach (MeshModifier mod in MeshModifiers.Where(x => x.Active))
        {
            mod.Run(feat, meshData, _map.WorldRelativeScale);
        }

        CreateGameObject(meshData);
    }