Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

321
Vistas
Can i remove this large space when using EditorGUILayout.PropertyField?

I'm getting into Editor Scripting in Unity and quickly get taken a back by this whole SerializedProperty thing. All i'm trying to do is make this Case Sensitive checkbox stick to the right of the inspector without all that space between the text and the box itself, leaving plenty of space for the TextField.

This is what i'm currently doing:

using (new EditorGUILayout.HorizontalScope())
{
    GUILayout.Label("Search for:", GUILayout.Width(64));
    searchText = GUILayout.TextField(searchText);
    EditorGUILayout.PropertyField(propCaseSensitive, GUILayout.MinWidth(0), GUILayout.ExpandWidth(false));
}

This is what i get

I've tried GUILayout.Width and GUILayout.MaxWidth and GUILayout.ExpandWidth(false) combined with GUILayout.MinWidth (and also just by them selves)

None of which have worked, i've been stuck trying to get this simple script to work for a bit too long for me to admit and it's driving me crazy. Please help me out, Thank you :)

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

I think you can do it similar to your other label.

PropertyField has an overload taking GUIContent label. By passing in GUIContent.none you omit the label and can instead add your own one:

                                                          // Not sure if even needed but adjust to the width you need
EditorGUILayout.LabelField(propCaseSensitive.displayName, GUILayout.Width(64), GUILayout.ExpandWidth(false));
                                                 // Don't draw the name via the default property field layout
EditorGUILayout.PropertyField(propCaseSensitive, GUIContent.none, GUILayout.ExpandWidth(false));
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda