Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

324
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda