本日はツールの調査枠です。
MicrosoftからはMixedRealityToolkit以外にも多くの開発者向けのSDKが公開されています。
その一例として[Microsoft Map-SDK for Unity(以下Map-SDK)]を調査しています。
前回はMap-SDKを導入しました。
〇Exampleを読み解く
Map-SDKにはExamplesとしてサンプルシーンが同梱されており、Map-SDKを用いたデモを体験できます。
各シーンごとに[Map]オブジェクト内の[Map Session]コンポーネントの[Developer Key]を入力する必要があります。
この[Developer Key]は前回の導入の記事で紹介しています。
〇CityTourExample
[CityTourExample]ではシーンを実行すると約2分ほどかけてシアトルの各所を移り変わりながらみていくことができるサンプルです。
[Map]オブジェクトには[Seattle tour]コンポーネント
public class SeattleTour : MonoBehaviour { ... void Start() { StartCoroutine(RunTour()); } private IEnumerator RunTour() { yield return new WaitForSeconds(5.0f); while (isActiveAndEnabled) // loop the tour as long as we are running. { foreach (var scene in MapScenes) { yield return _map.SetMapScene(scene); yield return new WaitForSeconds(3.0f); } } } }
[SeattleTour]コンポーネントはStart関数でコルーチンを実行しています。
private IEnumerator RunTour() { yield return new WaitForSeconds(5.0f); while (isActiveAndEnabled) // loop the tour as long as we are running. { foreach (var scene in MapScenes) { yield return _map.SetMapScene(scene); yield return new WaitForSeconds(3.0f); } } }
コルーチン内では3秒ごとに[MapScenes(scene)]を変えています。
[MapScenes()]関数は[MapRenderer]の[Latitude][Longitude]とスケールを与えることができます。
この[scene]の[MapScene]はList型で宣言されています。
private static readonly List<MapScene> MapScenes = new List<MapScene> { // Space Needle -> zoom out to Seattle Center new MapSceneOfLocationAndZoomLevel(new LatLon(47.620365, -122.349305), 17.0f), // MOHAI/wooden boats new MapSceneOfLocationAndZoomLevel(new LatLon(47.626872, -122.336026), 17.0f), new MapSceneOfLocationAndZoomLevel(new LatLon(47.627584, -122.336609), 18.0f), new MapSceneOfLocationAndZoomLevel(new LatLon(47.628131, -122.336676), 19.0f), // Gas Works new MapSceneOfLocationAndZoomLevel(new LatLon(47.644556, -122.335012), 16.0f), new MapSceneOfLocationAndZoomLevel(new LatLon(47.645065, -122.334899), 18.0f), // St Marks new MapSceneOfLocationAndZoomLevel(new LatLon(47.631862, -122.321263), 16.0f), new MapSceneOfLocationAndZoomLevel(new LatLon(47.631862, -122.321263), 18.0f), // Volunteer Park new MapSceneOfLocationAndZoomLevel(new LatLon(47.630118, -122.314719), 16.75f), new MapSceneOfLocationAndZoomLevel(new LatLon(47.628994, -122.31457), 18.0f), // Cal Anderson Park new MapSceneOfLocationAndZoomLevel(new LatLon(47.618389, -122.319168), 17.0f), new MapSceneOfLocationAndZoomLevel(new LatLon(47.615401, -122.318979), 18.0f), // Columbia Center -> Downtown new MapSceneOfLocationAndZoomLevel(new LatLon(47.603035, -122.331509), 16.0f), // Stadiums new MapSceneOfLocationAndZoomLevel(new LatLon(47.595005, -122.331778), 17.0f), new MapSceneOfLocationAndZoomLevel(new LatLon(47.591358, -122.332373), 17.0f), // Waterfront new MapSceneOfLocationAndZoomLevel(new LatLon(47.606085, -122.342533), 18.5f), new MapSceneOfLocationAndZoomLevel(new LatLon(47.607588, -122.343334), 18.5f), // Pike Place Market new MapSceneOfLocationAndZoomLevel(new LatLon(47.61043, -122.343521), 19.5f), new MapSceneOfLocationAndZoomLevel(new LatLon(47.608699, -122.340571), 19.5f), // Zoom out new MapSceneOfLocationAndZoomLevel(new LatLon(47.608699, -122.340571), 15f), };
〇シアトルツアー
・ スペースニードル⇒シアトルセンター
スペースニードルはシアトルの有名なタワーです。1962年の万博で建てられたもので日本でいうところの太陽の塔のような象徴的建物です。
・MOHAI 木製ボート
MOHAIはシアトルの歴史産業博物館です。
港に隣接しており、ツアーでは木製ボートまで見ることができます。
・ガス工場
シアトルのガス工場です。
・セント・マークス・イピスコパル大聖堂
シアトルの大きな協会です。
・ボランティア公園
・カル・アンダーソン公園
カル・アンダーソン公園は高台にあるシアトルの公園です。
・コロンビアセンター→シアトルダウンタウン
コロンビアセンターはシアトルダウンタウンの超高層ビルです。 76階建てで完成当時アメリカ西海岸で最も高い建物でした。現在は4番目に高いビルのようです。
・スタジアム
シアトルのスタジアムです。
・ウォーターフロント
ウォーターフロントとは湾岸部の開発区域のことを指す言葉です。
シアトルのウォーターフロントの観覧車から湾岸部の通りをめぐります。
・パイクプレイスマーケット
最後にパイクプレイスマーケットをめぐります。
パイクプレイスマーケットはシアトルの市場で1907年に始まった最も古い市場の一つです。