コード例 #1
0
        private void SetUpPins(float Latitude, float Longitude, String Title, String Text, String Username, String postTime)
        {
            Vector2d pos1   = new Vector2d(Latitude, Longitude);
            Vector3  pinPos = _mapManager.GeoToWorldPosition(pos1);

            pinPos = new Vector3(pinPos.x, 0.1f, pinPos.z);
            GameObject newPin = Instantiate(pin, pinPos, pin.transform.rotation);
            PinPost    pPost  = newPin.GetComponent <PinPost>();

            pPost.SetMessage(Title, Text, Username, postTime, pos1);
            _PinCanvasActions.UpdatePin(pPost);
        }
コード例 #2
0
        /*
         *
         *
         *
         *
         *
         * WORKING ON THIS PART XDDDDDDDDD
         *
         *
         *
         *
         *
         */

        public void CreatePin(String[] pinInfo, Vector3 pos, Vector2d latlongDelta)
        {
            GameObject newPin = Instantiate(pin, pos, pin.transform.rotation);
            PinPost    pPost  = newPin.GetComponent <PinPost>();

            pPost.SetMessage(pinInfo[0], pinInfo[1], latlongDelta);
            _PinCanvasActions.UpdatePin(pPost);

            LocationResponse location = new LocationResponse();

            location.Latitude  = (float)latlongDelta.x;
            location.Longitude = (float)latlongDelta.y;

            //Location loc = new Location((float)latlongDelta.x, (float)latlongDelta.y);
            Location loc      = new Location();
            int      indexLat = ChunkManager.GetChunkNumNS(loc);

            Debug.Log("Chunk index for lat " + indexLat);
            int indexLon = ChunkManager.GetChunkNumEW(loc);

            Debug.Log("Chunk index for lat " + indexLon);

            UserResponse author = new UserResponse()
            {
                RealName = "ram",
                UserName = "******",
                Location = location
            };

            PostResponse post = new PostResponse()
            {
                Author         = author,
                Title          = pinInfo[0],
                Text           = pinInfo[1],
                TimeStamp      = DateTime.Now,
                ApprovalRating = 0,
                NodeLocation   = location,
                ChunkIndexNS   = indexLat,
                ChunkIndexEW   = indexLon
            };

            string jsonData = JsonConvert.SerializeObject(post);

            StartCoroutine(ClientAPITest.Post("https://kettlex-server.herokuapp.com/postMessage", jsonData));
        }