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

スクリプト言語

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

EditorGUILayout.IntPopup

フィードバック

ありがとうございます

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

閉じる

送信に失敗しました

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

閉じる

キャンセル

マニュアルに切り替える
public static function IntPopup(selectedValue: int, displayedOptions: string[], optionValues: int[], params options: GUILayoutOption[]): int;
public static int IntPopup(int selectedValue, string[] displayedOptions, int[] optionValues, params GUILayoutOption[] options);
public static function IntPopup(selectedValue: int, displayedOptions: string[], optionValues: int[], style: GUIStyle, params options: GUILayoutOption[]): int;
public static int IntPopup(int selectedValue, string[] displayedOptions, int[] optionValues, GUIStyle style, params GUILayoutOption[] options);
public static function IntPopup(selectedValue: int, displayedOptions: GUIContent[], optionValues: int[], params options: GUILayoutOption[]): int;
public static int IntPopup(int selectedValue, GUIContent[] displayedOptions, int[] optionValues, params GUILayoutOption[] options);
public static function IntPopup(selectedValue: int, displayedOptions: GUIContent[], optionValues: int[], style: GUIStyle, params options: GUILayoutOption[]): int;
public static int IntPopup(int selectedValue, GUIContent[] displayedOptions, int[] optionValues, GUIStyle style, params GUILayoutOption[] options);
public static function IntPopup(label: string, selectedValue: int, displayedOptions: string[], optionValues: int[], params options: GUILayoutOption[]): int;
public static int IntPopup(string label, int selectedValue, string[] displayedOptions, int[] optionValues, params GUILayoutOption[] options);
public static function IntPopup(label: string, selectedValue: int, displayedOptions: string[], optionValues: int[], style: GUIStyle, params options: GUILayoutOption[]): int;
public static int IntPopup(string label, int selectedValue, string[] displayedOptions, int[] optionValues, GUIStyle style, params GUILayoutOption[] options);
public static function IntPopup(label: GUIContent, selectedValue: int, displayedOptions: GUIContent[], optionValues: int[], params options: GUILayoutOption[]): int;
public static int IntPopup(GUIContent label, int selectedValue, GUIContent[] displayedOptions, int[] optionValues, params GUILayoutOption[] options);
public static function IntPopup(label: GUIContent, selectedValue: int, displayedOptions: GUIContent[], optionValues: int[], style: GUIStyle, params options: GUILayoutOption[]): int;
public static int IntPopup(GUIContent label, int selectedValue, GUIContent[] displayedOptions, int[] optionValues, GUIStyle style, params GUILayoutOption[] options);

パラメーター

label フィールドのラベル
selectedValue フィールドに表示するオプションの値
displayedOptions ユーザーが選択できる表示されるオプションの配列
optionValues 各オプションの値の配列
style オプションの GUIStyle
options 特別なレイアウト対応をするためのレイアウトオプションリスト。ここに渡された値は style で定義された設定を上書きします。
See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.

戻り値

int ユーザーによって設定された値

説明

整数をポップアップして選択するフィールドを作成します。

現在選択されている整数をパラメーターとして受け取り、ユーザーによって選択された整数を返します。


”現在選択した GameObject を再スケールします。"

	// Simple Editor Script that lets you rescale the current selected GameObject.
	
	class EditorGUILayoutIntPopup extends EditorWindow {
		var selectedSize : int = 1;
		var names : String[] = ["Normal", "Double", "Quadruple"];
		var sizes : int[] = [1,2,4];
		
		@MenuItem("Examples/Editor GUILayout Int Popup usage")
		static function Init() {
			var window = GetWindow(EditorGUILayoutIntPopup);
			window.Show();
		}
		function OnGUI() {
			selectedSize = EditorGUILayout.IntPopup("Resize Scale: ", selectedSize, names, sizes);
			if(GUILayout.Button("Scale"))
				ReScale();
		}
		function ReScale() {
			if(Selection.activeTransform)
				Selection.activeTransform.localScale =
					Vector3(selectedSize, selectedSize, selectedSize);
			else	Debug.LogError("No Object selected, please select an object to scale.");
		}
	}

public static function IntPopup(property: SerializedProperty, displayedOptions: GUIContent[], optionValues: int[], label: GUIContent, style: GUIStyle, params options: GUILayoutOption[]): void;
public static void IntPopup(SerializedProperty property, GUIContent[] displayedOptions, int[] optionValues, GUIContent label, GUIStyle style, params GUILayoutOption[] options);
public static function IntPopup(property: SerializedProperty, displayedOptions: GUIContent[], optionValues: int[], params options: GUILayoutOption[]): void;
public static void IntPopup(SerializedProperty property, GUIContent[] displayedOptions, int[] optionValues, params GUILayoutOption[] options);
public static function IntPopup(property: SerializedProperty, displayedOptions: GUIContent[], optionValues: int[], label: GUIContent, params options: GUILayoutOption[]): void;
public static void IntPopup(SerializedProperty property, GUIContent[] displayedOptions, int[] optionValues, GUIContent label, params GUILayoutOption[] options);

パラメーター

property フィールドに表示するオプションの値
displayedOptions ユーザーが選択できる表示されるオプションの配列
optionValues 各オプションの値の配列
label フィールドのラベル
options 特別なレイアウト対応をするためのレイアウトオプションリスト。ここに渡された値は style で定義された設定を上書きします。
See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.

説明

整数をポップアップして選択するフィールドを作成します。