如何将照片对象统一转换为Texture2D?

时间:2017-05-01 10:35:24

标签: c# google-maps-api-3 unity5

如何检索照片对象以显示google在texture2D中的照片?

我使用无限码谷歌地图API并显示地名等级并放置照片,结果我得到了照片对象。现在帮我看看如何将这个照片对象转换为要显示的纹理。

public class FindPlacesExample: MonoBehaviour
{
   .......
    List<OnlineMapsMarker> markers = new List<OnlineMapsMarker>();

        //int count = 0;
        foreach (OnlineMapsGooglePlacesResult result in results)
        {
            //count++;
            // Log name and location of each result.
            //Debug.Log(result.name);
            //Debug.Log(result.location);

            // Create a marker at the location of the result.
            OnlineMapsMarker marker = OnlineMaps.instance.AddMarker(result.location, result.name);

            string[] customDataArray = new string[5];
            customDataArray[0]= result.place_id;
            customDataArray[1] = result.name.Replace("amp;","");
            customDataArray[2] = result.rating.ToString();
            customDataArray[3] = result.open_now.ToString();
            customDataArray[4] = "";


            marker.customData = customDataArray;
            marker.OnClick += OnMarkerClick;
            markers.Add(marker);

}

结果我得到了照片对象。

0 个答案:

没有答案