Version: 5.3 (switch to 5.4b)
IdiomaEnglish
  • C#
  • JS

Idioma de script

Selecciona tu lenguaje de programación favorito. Todos los fragmentos de código serán mostrados en este lenguaje.

EditorGUI.IntPopup

Sugiere un cambio

¡Éxito!

Gracias por ayudarnos a mejorar la calidad de la documentación de Unity. A pesar de que no podemos aceptar todas las sugerencias, leemos cada cambio propuesto por nuestros usuarios y actualizaremos los que sean aplicables.

Cerrar

No se puedo enviar

Por alguna razón su cambio sugerido no pudo ser enviado. Por favor <a>intente nuevamente</a> en unos minutos. Gracias por tomarse un tiempo para ayudarnos a mejorar la calidad de la documentación de Unity.

Cerrar

Cancelar

Cambiar al Manual
public static function IntPopup(position: Rect, selectedValue: int, displayedOptions: string[], optionValues: int[], style: GUIStyle = EditorStyles.popup): int;
public static int IntPopup(Rect position, int selectedValue, string[] displayedOptions, int[] optionValues, GUIStyle style = EditorStyles.popup);
public static function IntPopup(position: Rect, selectedValue: int, displayedOptions: GUIContent[], optionValues: int[], style: GUIStyle = EditorStyles.popup): int;
public static int IntPopup(Rect position, int selectedValue, GUIContent[] displayedOptions, int[] optionValues, GUIStyle style = EditorStyles.popup);
public static function IntPopup(position: Rect, selectedValue: int, displayedOptions: string[], optionValues: int[], style: GUIStyle = EditorStyles.popup): int;
public static int IntPopup(Rect position, int selectedValue, string[] displayedOptions, int[] optionValues, GUIStyle style = EditorStyles.popup);
public static function IntPopup(position: Rect, selectedValue: int, displayedOptions: GUIContent[], optionValues: int[], style: GUIStyle = EditorStyles.popup): int;
public static int IntPopup(Rect position, int selectedValue, GUIContent[] displayedOptions, int[] optionValues, GUIStyle style = EditorStyles.popup);
public static function IntPopup(position: Rect, label: string, selectedValue: int, displayedOptions: string[], optionValues: int[], style: GUIStyle = EditorStyles.popup): int;
public static int IntPopup(Rect position, string label, int selectedValue, string[] displayedOptions, int[] optionValues, GUIStyle style = EditorStyles.popup);
public static function IntPopup(position: Rect, label: string, selectedValue: int, displayedOptions: string[], optionValues: int[], style: GUIStyle = EditorStyles.popup): int;
public static int IntPopup(Rect position, string label, int selectedValue, string[] displayedOptions, int[] optionValues, GUIStyle style = EditorStyles.popup);
public static function IntPopup(position: Rect, label: GUIContent, selectedValue: int, displayedOptions: GUIContent[], optionValues: int[], style: GUIStyle = EditorStyles.popup): int;
public static int IntPopup(Rect position, GUIContent label, int selectedValue, GUIContent[] displayedOptions, int[] optionValues, GUIStyle style = EditorStyles.popup);
public static function IntPopup(position: Rect, label: GUIContent, selectedValue: int, displayedOptions: GUIContent[], optionValues: int[], style: GUIStyle = EditorStyles.popup): int;
public static int IntPopup(Rect position, GUIContent label, int selectedValue, GUIContent[] displayedOptions, int[] optionValues, GUIStyle style = EditorStyles.popup);

Parámetros

position Rectangle on the screen to use for the field.
label Optional label in front of the field.
selectedValue The value of the option the field shows.
displayedOptions An array with the displayed options the user can choose from.
optionValues An array with the values for each option. If optionValues a direct mapping of selectedValue to displayedOptions is assumed.
style Optional GUIStyle.

Valor de retorno

int The value of the option that has been selected by the user.

Descripción

Make an integer popup selection field.

Takes the currently selected integer as a parameter and returns the integer selected by the user.


Int Popup in an Editor Window.

	// Multiplies the scale of the selected transform.
	
	
	class EditorGUIIntPopup extends EditorWindow {

var selectedSize : int = 1; var names : String[] = ["Double", "Triple", "Quadruple"]; var sizes : int[] = [2,3,4]; @MenuItem("Examples/Editor GUI Int Popup usage") static function Init() { var window = GetWindow(EditorGUIIntPopup); window.position = Rect(0,0,180,60); window.Show(); } function OnGUI() { selectedSize = EditorGUI.IntPopup( Rect(3,3,position.width - 6,20), "Size:", selectedSize, names, sizes); if(GUI.Button(Rect(0,25,position.width,position.height - 27), "Modify")) Rescale(); } function Rescale() { if(Selection.activeTransform) Selection.activeTransform.localScale *= selectedSize; else Debug.LogError("No Object selected, please select an object to scale."); } }

public static function IntPopup(position: Rect, property: SerializedProperty, displayedOptions: GUIContent[], optionValues: int[], label: GUIContent = null): void;
public static void IntPopup(Rect position, SerializedProperty property, GUIContent[] displayedOptions, int[] optionValues, GUIContent label = null);
public static function IntPopup(position: Rect, property: SerializedProperty, displayedOptions: GUIContent[], optionValues: int[], label: GUIContent = null): void;
public static void IntPopup(Rect position, SerializedProperty property, GUIContent[] displayedOptions, int[] optionValues, GUIContent label = null);

Parámetros

position Rectangle on the screen to use for the field.
property The SerializedProperty to use for the control.
displayedOptions An array with the displayed options the user can choose from.
optionValues An array with the values for each option. If optionValues a direct mapping of selectedValue to displayedOptions is assumed.
label Optional label in front of the field.

Descripción