Sprite Shape Renderer コンポーネントは、Unity が スプライン に沿って生成したジオメトリをレンダリングし、2D と 3D プロジェクト 両方のシーンでの外観を制御します。その入力は、Sprite Shape プロファイル から行われます。
プロパティ | 機能 | |
---|---|---|
Color | スプライトシェイプに色を付けたり、色を変更するスプライトシェイプジオメトリの頂点色を定義します。頂点を設定するには、カラーピッカーを使用します。この表の下にある Color のセクションに例があります。 | |
Mask Interaction | Sprite Mask と相互作用する場合に、Sprite Renderer の挙動を設定します。後述の Mask Interaction セクションで、さまざまな設定例を参照してください。 | |
圧縮なし | スプライトシェイプレンダラーは、シーンのスプライトマスクと相互作用しません。これがデフォルトのオプションです。 | |
Visible Inside Mask | Sprite Mask が覆っている部分のスプライトは表示されますが、覆っていない部分は表示されません。 | |
Visible Outside Mask | スプライトマスクが覆っていない部分のスプライトは表示されますが、覆っている部分は表示されません。 | |
Sorting Layer | スプライトシェイプジオメトリの ソーティングレイヤー を設定します。ソーティングレイヤーはレンダリング時の優先順位を設定します。ドロップダウンボックスから既存のソーティングレイヤーを選択するか、新規に作成します。 | |
Order in Layer | ソーティングレイヤー 内のスプライトシェイプのレンダリング優先順位を設定します。小さな数のスプライトシェイプが最初にレンダリングされ、大きな数のスプライトシェイプがそれらの上にレンダリングされます。 |
以下の例は、スプライトシェイプレンダラーの Color 設定で RGB 値を変更した場合のものです。スプライトシェイプの不透明度を変更するには、アルファ (A) チャンネルの値を変更します。値が小さいほど、スプライトは透明に見え、値が大きいほど、スプライトは不透明に見えます。
Material の Material と Shader の設定 を使って、Unity が Fill (塗りつぶし) や Edge (端) のジオメトリをどのようにレンダリングするかをコントロールします。新しいスプライトシェイプのデフォルトマテリアルは ‘Sprites - Default’ です。シーンライティングはこのデフォルトのスプライトシェイプには影響しません。スプライトがライティングに反応するようにするには、代わりにマテリアル ‘Default - Diffuse’ を割り当てます。これを行うには、Material フィールドの隣にある小さな丸をクリックして、Object Picker ウィンドウを表示し、‘Default-Diffuse’ マテリアルを選択します。これらの設定の詳細については、マテリアル、シェーダー、テクスチャ を参照してください。
Mask Interaction は、スプライトシェイプレンダラーが スプライトマスク とどのように相互作用するかを制御します。 Visible Inside Mask または Visible Outside Mask のいずれかを Mask Interaction のドロップダウンメニューから選択します。以下の例は、それらの効果を示しています。
SpriteShapeRenderer
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.