Saturday, October 8, 2022
HomeGame Developmentunity - How match content material inside EditorGUILayout.BeginScrollView to forestall horizontal scrolling?

unity – How match content material inside EditorGUILayout.BeginScrollView to forestall horizontal scrolling?


I’m defining a customized editor window, and utilizing EditorGUILayout.BeginScrollView to permit the remainder of the content material to be seen when it turns into too lengthy vertically.

I’m nonetheless not serious about horizontal scrolling, and can’t appear to discover a technique to trigger the horizontal content material to suit within the scrollbar. It robotically overflows.

Is there any technique to outline the width of the world that comprises all the things?

I’ve this within an editor window script:

Vector2 scrollPos;

void OnGUI()
{
    GUILayout.Label("nQwAbA");

    EditorGUILayout.Separator();
    if (Selection.activeGameObject)
    {
        EditorGUILayout.BeginVertical(GUILayout.MaxWidth(100));

        scrollPos =  EditorGUILayout.BeginScrollView(scrollPos);
        // GUILayout.BeginArea(new Rect(Vector2.zero,new Vector2(place.width,place.top)));
      GameObject n = Selection.activeGameObject;
        NKWABA nkwaba = n.GetComponentInChildren<NKWABA>();
        if (nkwaba)
        {


            EditorGUILayout.BeginHorizontal();
            if (GUILayout.Button("INIT"))
            {
                nkwaba.INIT();
            }
            if (GUILayout.Button("CYCLE"))
            {
                nkwaba.CYCLE();
            }

            EditorGUILayout.EndHorizontal();
            EditorGUILayout.Separator();
            GUILayout.Label(nkwaba.jointLabel.textual content);
            nkwaba.title.textual content = EditorGUILayout.TextField("Pose Title", nkwaba.title.textual content);

            EditorGUILayout.Separator();

            
          //  GUILayout.EndArea();
            EditorGUILayout.EndScrollView();
            EditorGUILayout.EndVertical();

        }
    }
    else
    {
        GUILayout.Label("Select nQwAbA");
    }

}

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments