Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/275.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在unity中使用GoogleMapAPI,c#_C#_Google Maps_Unity3d_Google Maps Api 3_Google Maps Android Api 2 - Fatal编程技术网

如何在unity中使用GoogleMapAPI,c#

如何在unity中使用GoogleMapAPI,c#,c#,google-maps,unity3d,google-maps-api-3,google-maps-android-api-2,C#,Google Maps,Unity3d,Google Maps Api 3,Google Maps Android Api 2,有人能告诉我如何在unity中使用google map api吗。 我知道如何使用静态映射,因为它是一个图像,但另一个API是返回json,我如何使用它,如何在unity中显示路由,我只为java找到方法,如何在c#中使用unity 您希望通过以下方式处理传入的json: 将返回的json反序列化到类中并处理结果 -具有您需要的所有请求参数和示例 您还可以使用以下库: 如何访问Web请求: 这是一个如何使用连接到unity的天气api的示例。 它从我所在的位置收集我需要的数据,取决于我所在的天气

有人能告诉我如何在unity中使用google map api吗。
我知道如何使用静态映射,因为它是一个图像,但另一个API是返回json,我如何使用它,如何在unity中显示路由,我只为java找到方法,如何在c#中使用unity


您希望通过以下方式处理传入的json: 将返回的json反序列化到类中并处理结果

-具有您需要的所有请求参数和示例

您还可以使用以下库:

如何访问Web请求:

这是一个如何使用连接到unity的天气api的示例。 它从我所在的位置收集我需要的数据,取决于我所在的天气,它要么开始下雪/下雨,要么是晴天/多云。 你可以用同样的方法使用谷歌地图api。收集、提供并重复

    private async Task<WeatherInfo> GetWeather()
{
    HttpWebRequest request = (HttpWebRequest)WebRequest.Create(String.Format("http:/g/data/2.5/weather?id=" + CityId + "&APPID=" + API_KEY));

    WebResponse response = await request.GetResponseAsync();
    StreamReader reader = new StreamReader(response.GetResponseStream());
    string jsonResponse = reader.ReadToEnd();
    WeatherInfo info = JsonUtility.FromJson<WeatherInfo>(jsonResponse);
    string weatherString = info.weather[0].main;       
    return info;
private异步任务GetWeather()
{
HttpWebRequest request=(HttpWebRequest)WebRequest.Create(String.Format(“http:/g/data/2.5/weather?id=“+CityId+”&APPID=“+API_KEY”);
WebResponse=wait request.GetResponseAsync();
StreamReader=新的StreamReader(response.GetResponseStream());
字符串jsonResponse=reader.ReadToEnd();
WeatherInfo=JsonUtility.FromJson(jsonResponse);
字符串weatherString=info.weather[0].main;
退货信息;

您会尝试什么?