Home Game Development c# – How to scale the width of the content material inside EditorGUILayout.BeginScrollView in Unity

c# – How to scale the width of the content material inside EditorGUILayout.BeginScrollView in Unity

0
c# – How to scale the width of the content material inside EditorGUILayout.BeginScrollView in Unity

[ad_1]

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

I’m nevertheless not concerned 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 realm that accommodates the whole lot?
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");
            }

        }
```

[ad_2]

LEAVE A REPLY

Please enter your comment!
Please enter your name here