Version: 5.3 (switch to 5.4b)
言語English
  • C#
  • JS

スクリプト言語

好きな言語を選択してください。選択した言語でスクリプトコードが表示されます。

EditorGUILayout.Space

フィードバック

ありがとうございます

この度はドキュメントの品質向上のためにご意見・ご要望をお寄せいただき、誠にありがとうございます。頂いた内容をドキュメントチームで確認し、必要に応じて修正を致します。

閉じる

送信に失敗しました

なんらかのエラーが発生したため送信が出来ませんでした。しばらく経ってから<a>もう一度送信</a>してください。ドキュメントの品質向上のために時間を割いて頂き誠にありがとうございます。

閉じる

キャンセル

マニュアルに切り替える
public static function Space(): void;
public static void Space();

説明

前のコントロールと次のコントロールの間に小さなスペースを作成します。


" Transform の X、Y、Z、W Quaternion Component を表示するカスタムのインスペクター"

	// Create a custom transform inspector that shows the X,Y,Z,W quaternion components
	// instead of the rotation angles.
	
	class InspectorTitlebarUsage extends EditorWindow {
		
		var fold : boolean = true;
		var rotationComponents : Vector4;
		var selectedTransform : Transform;
		
		@MenuItem("Examples/Inspector Titlebar")
		static function Init() {
			var window = GetWindow(InspectorTitlebarUsage);
			window.Show();
		}	
		function OnGUI() {	
			if(Selection.activeGameObject) {
				selectedTransform = Selection.activeGameObject.transform;
				fold = EditorGUILayout.InspectorTitlebar(fold, selectedTransform);
				if(fold) {
					selectedTransform.position = 
						EditorGUILayout.Vector3Field("Position", selectedTransform.position);
					EditorGUILayout.Space();
					rotationComponents = 
						EditorGUILayout.Vector4Field("Detailed Rotation", 
							QuaternionToVector4(selectedTransform.localRotation));
					EditorGUILayout.Space();
					selectedTransform.localScale =
						EditorGUILayout.Vector3Field("Scale", selectedTransform.localScale);
				}
				selectedTransform.localRotation = ConvertToQuaternion(rotationComponents);
				EditorGUILayout.Space();
			}
		}
		
		function ConvertToQuaternion(v4 : Vector4) {
			return Quaternion(v4.x, v4.y, v4.z, v4.w);
		}
		function QuaternionToVector4(q : Quaternion) {
			return Vector4(q.x, q.y, q.z, q.w);
		}	
		function OnInspectorUpdate() {
			this.Repaint();
		}
	}