SortingLayer は複数のスプライトのレンダリングの順序を簡単に設定することができます。デフォルトの SortingLayer の名前は最初に追加されるすべてのスプライトはどれでも常に "Default" なります。スプライトのグループのレンダリングの順序の制御を簡単にするために多くの SortingLayers が追加されます。レイヤーはデフォルトのレイヤーの前後に命じることができます。
関連項目: Tags and Layers.
layers | このプロジェクトで定義されているすべてのレイヤーを返します。 |
onLayerAdded | Delegate for sorting layer events when a layer is added. |
onLayerRemoved | Delegate for sorting layer events when a layer is removed. |
id | これはレイヤーに割り当てられたユニーク ID です。オーダーされた実行中の値ではないので、ソート順を決定する他のレイヤーと比較することに使用しないでください。 |
name | TagManager で定義されたレイヤーの名前を返します。 |
value | 他のレイヤーを基準にしてこのレイヤーのソート順を示す相対的な値です。 |
GetLayerValueFromID | 最後にソートしたレイヤー値を返します。いろいろなソートをするレイヤーの間でソートする順番を決定するために、最後のソート値を取得するこのメソッドを使い、順序を決定する CompareTo を使用します。 |
GetLayerValueFromName | 最後にソートしたレイヤー値を返します。参照: GetLayerValueFromID |
IDToName | レイヤーのユニーク ID を返します。無効な ID が指定された場合は "<unknown layer>" を返します。 |
IsValid | 提供された ID が有効なレイヤー ID の場合、True を返します。 |
NameToID | 名前を与えられた ID を返します。無効な名前が与えられた場合は 0 を返します。 |
LayerCallback | Calls the methods in its invocation list when a sorting layer is added or removed. |
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.