アイソメトリックタイルマップ を作成するとき、通常のタイルマップの作成 に加え、追加の手順があります。アイソメトリックタイルマップを作成するには、GameObject > 2D Object > Isometric Tilemap (または Isometric Z as Y Tilemap) の順に選択します。
アイソメトリックタイルマップ作成後、適切にレンダリングするために Project と Grid を設定する必要があります。
アイソメトリックタイルマップのタイルをレンダリングするには、タイルマップの「後方」に配置されるタイルを「手前」に配置されるタイルより先にレンダリングして、アイソメトリック投影法 (等角投影法とも呼ばれます) の 疑似深度 を作る必要があります。シーン内のすべてのレンダラーにこのロジックを当てはめるためには、ソート軸 にカスタムの軸を使用します。 Transparency Sort Mode を ‘Custom Axis’ に設定し、Transparency Sort Axis の XYZ 値に (0,1,0) を入力します。
Edit > Project Settings… > Graphics > Camera Settings の順に移動して ‘Custom Axis’ を設定します。
Transparency Sort Axis の XYZ の値を (0,1,0) に設定すると、シーンでより高い Y 位置にあるレンダラーが最初にレンダリングされ、より低い Y 位置のレンダラーの背後にあるように見えます。
Isometric Z as Y Tilemap を使用すると、Z 位置の値 が異なるタイルは Y 軸に沿ってオフセットされ、異なる高さにあるように見え、同じ XY セルのタイルを使って「積み上げているような」効果を生みます。デフォルトでは、アイソメトリックの元の Transparency Sort Axis 設定 (0,1,0) では、ソートにタイルの Z 位置の値は考慮されません。そのため、タイルは意図しない順序でレンダリングされます (下の例を参照)。
Transparency Sort Axis を (0,1,–0.26) に設定すると、Z 位置が異なるタイルを正しくレンダリングできます。Z 軸は –0.26 に設定され、より高い Z 位置のタイルが最初に描画されるようにバイアスを与えます。
Isometric | Creates an Isometric Tilemap with the default settings. |
Isometric Z As Y | Creates an Isometric Tilemap where a Tile’s Z-axis value is added to its Y-axis value. This causes the Tile to be visually offset along the Y-axis by that value, creating the illusion of height as the Tiles are placed on the Tilemap. |
アイソメトリックタイルマップは 二等角投影法 か アイソメトリック投影法 の平行投影角度を使用します。2 つの投影法の詳細は、こちらのページ (英語) を参照してください。
Grid コンポーネントの Cell Size を変更すると、各セルを構成する角度が変更され、シミュレーションされる投影のタイプに影響します。デフォルトでは、Cell Layout が Isometric の際のセルサイズは (1, 0.5, 1) で、二等角投影法 の角度をシミュレーションします。アイソメトリック投影法 の角度をシミュレーションするには、Y の値を ‘0.57735’ に設定します。
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.