お好みのスクリプト言語を選択すると、サンプルコードがその言語で表示されます。
Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
Close現在実行中のGUI動作のデプス
これは同時に実行されている他のスクリプトのGUIとの描画順を制御するために設定します。
depthが低い値のGUI要素は高い値のGUI要素より上に描画されます(たとえばカメラからの「距離」をデプスと考えることができます)
注意: この例を動かすにはスクリプトを2つ作成する必要があります。
スクリプトファイル名とクラス名を同じにした場合は
動かないことを忘れないようにしましょう。
背後に他のボタン
// Makes this button go back in depth over the example2 class one. class example1 extends MonoBehaviour { static var guiDepth : int = 0; function OnGUI() { GUI.depth = guiDepth; if(GUI.RepeatButton(Rect(0,0,100,100), "GoBack")) { guiDepth = 1; example2.guiDepth = 0; } } }
no example available in C#
no example available in Boo
そして別のスクリプトにこの例のコードをコピーします
// Makes this button go back in depth over the example1 class one. class example2 extends MonoBehaviour { static var guiDepth : int = 1; function OnGUI() { GUI.depth = guiDepth; if(GUI.RepeatButton(Rect(50,50,100,100), "GoBack")) { guiDepth = 1; example1.guiDepth = 0; } } }
no example available in C#
no example available in Boo